mirror of
https://github.com/dart-lang/sdk
synced 2024-09-19 14:32:49 +00:00
62c042d679
BUG=http://dartbug.com/8325,http://dartbug.com/9056 R=karlklose@google.com Review URL: https://codereview.chromium.org//19097003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25553 260f80e4-7a28-3924-810f-c04153c831b5
58 lines
1.2 KiB
Dart
58 lines
1.2 KiB
Dart
// Copyright (c) 2012, 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";
|
|
|
|
abstract class I {}
|
|
|
|
void main() {
|
|
var list;
|
|
list = <int
|
|
I /// 00: compile-time error
|
|
, int /// 01: static type warning
|
|
>[0];
|
|
Expect.equals(1, list.length);
|
|
|
|
list = <int
|
|
, int /// 02: static type warning
|
|
, int /// 02: continued
|
|
>[0];
|
|
Expect.equals(1, list.length);
|
|
|
|
list = <int
|
|
, int /// 03: static type warning
|
|
, int /// 03: continued
|
|
, int /// 03: continued
|
|
>[0];
|
|
Expect.equals(1, list.length);
|
|
|
|
list =
|
|
<> /// 04: compile-time error
|
|
[0];
|
|
Expect.equals(1, list.length);
|
|
|
|
list =
|
|
<<>> /// 05: compile-time error
|
|
[0];
|
|
Expect.equals(1, list.length);
|
|
|
|
list =
|
|
<<<>>> /// 06: compile-time error
|
|
[0];
|
|
Expect.equals(1, list.length);
|
|
|
|
list =
|
|
<[]> /// 07: compile-time error
|
|
[0];
|
|
Expect.equals(1, list.length);
|
|
|
|
list = <int>[<int>[<int>[1][0]][0]];
|
|
Expect.equals(1, list.length);
|
|
Expect.equals(1, list[0]);
|
|
|
|
list = <int>[<List<int>>[[1]][0][0]];
|
|
Expect.equals(1, list.length);
|
|
Expect.equals(1, list[0]);
|
|
}
|