Chromium Code Reviews| Index: tests/language/src/MapLiteral1NegativeTest.dart |
| =================================================================== |
| --- tests/language/src/MapLiteral1NegativeTest.dart (revision 0) |
| +++ tests/language/src/MapLiteral1NegativeTest.dart (revision 0) |
| @@ -0,0 +1,22 @@ |
| +// Copyright (c) 2011, 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_type_checks |
| +// |
| +// Dart test program testing type checks in map literals. |
| + |
| +class MapLiteral1NegativeTest<T> { |
|
hausner
2011/11/22 18:37:35
Why does this class need a type parameter?
regis
2011/11/22 20:15:20
It does not. Copy and paste error. Thanks. Done.
|
| + test() { |
| + try { |
| + var m = const <String>{"a": 0}; // 0 is not a String. |
| + } catch (TypeError error) { |
| + } |
| + } |
| +} |
| + |
| +main() { |
| + var t = new MapLiteral1NegativeTest<int>(); |
| + t.test(); |
| +} |
| + |
| + |