mirror of
https://github.com/dart-lang/sdk
synced 2024-09-19 14:32:49 +00:00
1692a15f4e
BUG=http://dartbug.com/16411 R=ricow@google.com Review URL: https://codereview.chromium.org//150223002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34412 260f80e4-7a28-3924-810f-c04153c831b5
30 lines
1.2 KiB
Dart
30 lines
1.2 KiB
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.
|
|
|
|
class A {
|
|
final int x;
|
|
const A.a1() : x = 'foo'; /// 01: continued
|
|
const A.a2(this.x);
|
|
const A.a3([this.x = 'foo']); /// 03: continued
|
|
const A.a4(String this.x); /// 04: continued
|
|
const A.a5(String x) : this.x = x; /// 05: continued
|
|
const A.a6(int x) : this.x = x;
|
|
}
|
|
|
|
var a1 = const A.a1(); /// 01: static type warning, checked mode compile-time error
|
|
var a2 = const A.a2('foo'); /// 02: static type warning, checked mode compile-time error
|
|
var a3 = const A.a3(); /// 03: static type warning, checked mode compile-time error
|
|
var a4 = const A.a4('foo'); /// 04: static type warning, checked mode compile-time error
|
|
var a5 = const A.a5('foo'); /// 05: static type warning, checked mode compile-time error
|
|
var a6 = const A.a6('foo'); /// 06: static type warning, checked mode compile-time error
|
|
|
|
main() {
|
|
print(a1); /// 01: continued
|
|
print(a2); /// 02: continued
|
|
print(a3); /// 03: continued
|
|
print(a4); /// 04: continued
|
|
print(a5); /// 05: continued
|
|
print(a6); /// 06: continued
|
|
}
|