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

Unified Diff: test/codegen/language/type_literal_test.dart

Issue 1945643005: Don't wrap type literals that are referenced by prefixes. (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « lib/src/compiler/code_generator.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/language/type_literal_test.dart
diff --git a/test/codegen/language/type_literal_test.dart b/test/codegen/language/type_literal_test.dart
index d689a0dc5e783f02a29dc00274e435efb2312d58..d0bba5d6f07c2fbf32254687cb494240af029b05 100644
--- a/test/codegen/language/type_literal_test.dart
+++ b/test/codegen/language/type_literal_test.dart
@@ -4,11 +4,16 @@
import "package:expect/expect.dart";
+import 'type_literal_test.dart' as prefix;
+
// TODO(rnystrom): This test has a lot of overlap with some other language
// tests, but those are sort of all over the place so I thought it useful to
// test all of the relevant bits in one place here.
-class Foo {}
+class Foo {
+ static var property;
+ static method() => "result";
+}
class Box<T> {
Type get typeArg => T;
@@ -49,4 +54,22 @@ main() {
Expect.identical(Box, Box);
Expect.identical(new Box<Foo>().typeArg, new Box<Foo>().typeArg);
Expect.identical(Func, Func);
+
+ // Static member uses are not type literals.
+ Foo.property = "value";
+ Expect.equals("value", Foo.property);
+ Expect.equals("result", Foo.method());
+
+ // Prefixed types are type literals.
+ testType(prefix.Foo, "Foo");
+
+ // Prefix member uses are not.
+ prefix.Foo.property = "value2";
+ Expect.equals("value2", prefix.Foo.property);
+ Expect.equals("result", prefix.Foo.method());
+}
+
+void testType(Type type, String string) {
+ Expect.equals(string, type.toString());
+ Expect.isTrue(type is Type);
}
« no previous file with comments | « lib/src/compiler/code_generator.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698