Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit b4e66c2

Browse files
committed
WIP nullary functions – add test for type with field and method with same name
work on #14
1 parent 9e68565 commit b4e66c2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

core/src/language/clsdefck.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,20 @@ mod tests {
152152
);
153153
}
154154

155+
#[test]
156+
fn field_and_method_with_same_name() {
157+
err(
158+
"
159+
class Foo(a: String)
160+
impl Foo {
161+
fun a: String = \"\"
162+
}
163+
",
164+
pos(1, 21),
165+
ErrorMessage::ShadowField("a".into()),
166+
);
167+
}
168+
155169
#[test]
156170
fn test_generic_class() {
157171
ok("class A[T]");

0 commit comments

Comments
 (0)