03b7471b30
Say we have
class A{}
class B extends A { var x; }
and somewhere:
new A().x;
Then we would see if there was only one field 'x' in the whole type-hierarchy
(including B), but we failed to verify that the field was accessible from A.
Review URL: https://chromiumcodereview.appspot.com//10834343
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10841 260f80e4-7a28-3924-810f-c04153c831b5
24 lines
496 B
Dart
24 lines
496 B
Dart
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
// Dart test program for constructors and initializers.
|
|
|
|
// Test 'expression as Type' casts.
|
|
|
|
class C {
|
|
final int foo = 42;
|
|
}
|
|
|
|
class D extends C {
|
|
final int bar = 37;
|
|
}
|
|
|
|
main() {
|
|
Object oc = new C();
|
|
Object od = new D();
|
|
|
|
(oc as Dynamic).bar; /// 01: runtime error
|
|
}
|
|
|
|
|