mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:09:49 +00:00
688801cb27
Change-Id: I4daa09afa52f76076374591b3e3f3420a46b169b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134240 Commit-Queue: Bob Nystrom <rnystrom@google.com> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com> Auto-Submit: Bob Nystrom <rnystrom@google.com>
88 lines
1.5 KiB
Dart
88 lines
1.5 KiB
Dart
// TODO(multitest): This was automatically migrated from a multitest and may
|
|
// contain strange or dead code.
|
|
|
|
// Copyright (c) 2018, 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.
|
|
// VMOptions=--enable-asserts
|
|
// dart2jsOptions=--enable-asserts
|
|
//
|
|
// Test of asserts in initializer lists.
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
class C {
|
|
final int x;
|
|
// Const constructors.
|
|
const C.cc01(this.x, y) : assert(x < y);
|
|
const C.cc02(x, y)
|
|
: x = x,
|
|
assert(x < y);
|
|
const C.cc03(x, y)
|
|
: assert(x < y),
|
|
x = x;
|
|
const C.cc04(this.x, y)
|
|
: assert(x < y),
|
|
super();
|
|
const C.cc05(x, y)
|
|
: x = x,
|
|
assert(x < y),
|
|
super();
|
|
const C.cc06(x, y)
|
|
: assert(x < y),
|
|
x = x,
|
|
super();
|
|
const C.cc07(x, y)
|
|
: assert(x < y),
|
|
x = x,
|
|
assert(y > x),
|
|
super();
|
|
const C.cc08(this.x, y) : assert(x < y, "$x < $y");
|
|
const C.cc09(this.x, y) : assert(x < y,);
|
|
const C.cc10(this.x, y) : assert(x < y, "$x < $y",);
|
|
}
|
|
|
|
main() {
|
|
const x = 3;
|
|
{
|
|
|
|
const C.cc01(2, x);
|
|
}
|
|
{
|
|
|
|
const C.cc02(2, x);
|
|
}
|
|
{
|
|
|
|
const C.cc03(2, x);
|
|
}
|
|
{
|
|
|
|
const C.cc04(2, x);
|
|
}
|
|
{
|
|
|
|
const C.cc05(2, x);
|
|
}
|
|
{
|
|
|
|
const C.cc06(2, x);
|
|
}
|
|
{
|
|
|
|
const C.cc07(2, x);
|
|
}
|
|
{
|
|
|
|
const C.cc08(2, x);
|
|
}
|
|
{
|
|
|
|
const C.cc09(2, x);
|
|
}
|
|
{
|
|
|
|
const C.cc10(2, x);
|
|
}
|
|
}
|