1811a6b913
Old name Dynamic is supported, and automatically converted to lower-case dynamic when parsed. VM flag --warn_legacy_dynamic prints warnings when Dynamic is found. Review URL: https://codereview.chromium.org//11125005 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13637 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
|
|
}
|
|
|
|
|