Files
sdk/tests/language_2/const_constructor3_test.dart
T
Mike Fairhurst ca8e5baccd Fix #34443 fix tests that will fail with int2double
Bug: 34443
Change-Id: I2b0edb9f6f1e642c92a656301f9b8a85c3e4658c
Reviewed-on: https://dart-review.googlesource.com/74669
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-09-13 22:32:54 +00:00

26 lines
653 B
Dart

// Copyright (c) 2014, 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 C {
final double d;
const C(this.d);
}
class D extends C {
const D(var d) : super(d);
}
const intValue = 0;
const c = const C(0.0); //# 01: ok
const d = const C(intValue); //# 02: compile-time error
const e = const D(0.0); //# 03: ok
const f = const D(intValue); //# 04: compile-time error
main() {
print(c); //# 01: continued
print(d); //# 02: continued
print(e); //# 03: continued
print(f); //# 04: continued
}