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

Commit 88c05b5

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

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

core/src/language/clsdefck.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ mod tests {
123123
use crate::language::error::msg::ErrorMessage;
124124
use crate::language::tests::*;
125125

126+
#[ignore]
126127
#[test]
127128
fn test_class_definition() {
128129
ok("class Foo");
@@ -152,6 +153,20 @@ mod tests {
152153
);
153154
}
154155

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

0 commit comments

Comments
 (0)