mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +00:00
a719910d78
Interesting bits: - Removed some behavior that is now unreachable in the presence of type errors. - Made if_null_behavior_test not a multitest since it doesn't need to be any more. - Likewise, if_null_evaluation_order_test never needed to be a multitest. R=lrn@google.com Review-Url: https://codereview.chromium.org/3003933002 .
39 lines
1,006 B
Dart
39 lines
1,006 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.
|
|
|
|
import 'package:expect/expect.dart';
|
|
|
|
f() {}
|
|
const g = 1;
|
|
|
|
const identical_ff = identical(f, f);
|
|
const identical_fg = identical(f, g);
|
|
const identical_gf = identical(g, f);
|
|
const identical_gg = identical(g, g);
|
|
|
|
// Verify proper compile time computation of identical()
|
|
const a = const {
|
|
identical_ff: 0, //# 01: compile-time error
|
|
identical_gg: 0, //# 02: compile-time error
|
|
true: 0
|
|
};
|
|
|
|
const b = const {
|
|
identical_fg: 0, //# 03: compile-time error
|
|
identical_gf: 0, //# 04: compile-time error
|
|
false: 0
|
|
};
|
|
|
|
use(x) => x;
|
|
|
|
main() {
|
|
use(a);
|
|
use(b);
|
|
|
|
// Verify proper run time computation of identical()
|
|
Expect.isTrue(identical_ff); //# 05: ok
|
|
Expect.isTrue(identical_gg); //# 06: ok
|
|
Expect.isFalse(identical_fg); //# 07: ok
|
|
Expect.isFalse(identical_gf); //# 08: ok
|
|
}
|