mirror of
https://github.com/dart-lang/sdk
synced 2024-09-19 14:43:32 +00:00
5543ce104c
R=hausner@google.com Review URL: https://codereview.chromium.org//16780009 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23934 260f80e4-7a28-3924-810f-c04153c831b5
32 lines
781 B
Dart
32 lines
781 B
Dart
// Copyright (c) 2013, 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.
|
|
//
|
|
// Check proper canonicalization (fields must be canonicalized as well).
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
|
|
main() {
|
|
Expect.isFalse(identical(new Duration(days: 1), new Duration(days: 1)));
|
|
Expect.isTrue(identical(const Duration(days: 2), const Duration(days: 2)));
|
|
Expect.isTrue(identical(const B(3.0), const B(3.0)));
|
|
Expect.isTrue(identical(const F(main), const F(main)));
|
|
}
|
|
|
|
|
|
class A {
|
|
final a;
|
|
const A(v) : a = v + 3.4;
|
|
}
|
|
|
|
class B extends A {
|
|
final b;
|
|
const B(v) : super(v), b = v + 1.0;
|
|
}
|
|
|
|
class F {
|
|
final f;
|
|
const F(v) : f = v;
|
|
}
|