Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(576)

Unified Diff: tests/compiler/dart2js_extra/17856_test.dart

Issue 212693003: Fix handling of union on DictionaryTypeMask. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: improved handling of map keys Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js_extra/17856_test.dart
diff --git a/tests/compiler/dart2js_extra/17856_test.dart b/tests/compiler/dart2js_extra/17856_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..1e6fa63cd96b53bb46e9860d069d6659ebf0fd99
--- /dev/null
+++ b/tests/compiler/dart2js_extra/17856_test.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2014, 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";
+
+// Regression test for Issue 17856.
+
+void main() {
+ var all = { "a": new A(), "b": new B() };
+
+ A a = all["a"];
+ a.load();
+}
+
+class A {
+ Loader _loader = new Loader();
+
+ load() => _loader.loadAll({
+ 'a1': {}
+ });
+}
+
+class B {
+ Loader _loader = new Loader();
+
+ load() => _loader.loadAll({
+ 'a2': new DateTime.now(),
+ });
+}
+
+class Loader {
+ loadAll(Map assets) {
+ for(String key in assets.keys) {
+ Expect.isTrue(assets[key] is Map);
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698