Closed
Description
$ cat fisk.dart
int x = 89;
class Foo {
int x = 42;
}
class Bar extends Foo {
m() => x;
}
main() {
print(new Bar().m());
}
$ frogsh fisk.dart
42
$ dartc_test fisk.dart
89
$ cat fisk.dart
class x {
}
class Foo {
int x = 42;
}
class Bar extends Foo {
m() => x;
}
main() {
print(new Bar().m());
}
$ frogsh fisk.dart
42
$ dartc_test fisk.dart
fisk.dart:9: x is a class and cannot be used as an expression
8: class Bar extends Foo {
9: m() => x;
Compilation failed with 1 problem.
FWIW, there are a bunch of tests in dart/compiler/javatests/com/google/dart/compiler/{resolver,type}. Karl is already working on porting the tests from the type directory.