Files
sdk/tests/language_strong/variable_declaration_metadata_test.dart
T
Bob Nystrom 6c757957db Move the dev_compiler strong mode tests into sdk/tests/.
DDC's codegen test copies those files to a local "gen" directory so
that it can do stuff like splitting out the multitests before it
compiles them to JS.

I left all of that alone, so the rest of DDC's test infrastructure is
unchanged. The very first step that builds the "gen" directory just
copies from sdk/tests/..._strong/... instead and the rest is good to go.

I did not move not_yet_strong_tests.dart somewhere more accessible yet
because I'm not sure if kernel needs it or where it should go.

I did not create any status files because DDC doesn't need them and
there are no test suites for the new directories for the other
platforms.
2016-12-09 11:09:55 -08:00

87 lines
1.6 KiB
Dart

// Copyright (c) 2015, 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.
// Verify that the individual variable declarations inside a variable
// declaration list are not allowed to be annotated with metadata.
const annotation = null;
var
@annotation /// 01: compile-time error
v1,
@annotation /// 02: compile-time error
v2;
int
@annotation /// 03: compile-time error
v3,
@annotation /// 04: compile-time error
v4;
class C {
var
@annotation /// 05: compile-time error
f1,
@annotation /// 06: compile-time error
f2;
int
@annotation /// 07: compile-time error
f3,
@annotation /// 08: compile-time error
f4;
}
use(x) => x;
main() {
use(v1);
use(v2);
use(v3);
use(v4);
C c = new C();
use(c.f1);
use(c.f2);
use(c.f3);
use(c.f4);
var
@annotation /// 09: compile-time error
l1,
@annotation /// 10: compile-time error
l2;
int
@annotation /// 11: compile-time error
l3,
@annotation /// 12: compile-time error
l4;
use(l1);
use(l2);
use(l3);
use(l4);
for (var
@annotation /// 13: compile-time error
i1 = 0,
@annotation /// 14: compile-time error
i2 = 0; ; ) {
use(i1);
use(i2);
break;
}
for (int
@annotation /// 15: compile-time error
i3 = 0,
@annotation /// 16: compile-time error
i4 = 0; ; ) {
use(i3);
use(i4);
break;
}
}