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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java

Issue 64863002: Issue 14748. Name of type alias is a valid const expression. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
index 3bc7c1b42a1daf746a5637a41e1326b79d7f3172..9494b44a1266beeb55603b5d7cb6ac12f2698157 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
@@ -449,6 +449,15 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_constEval_functionTypeLiteral() throws Exception {
+ Source source = addSource(createSource(//
+ "typedef F();",
+ "const C = F;"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
public void test_constEval_propertyExtraction_fieldStatic_targetType() throws Exception {
addSource("/math.dart", createSource(//
"library math;",
@@ -2015,6 +2024,32 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_mixedReturnTypes_ignoreImplicit() throws Exception {
+ Source source = addSource(createSource(//
+ "f(bool p) {",
+ " if (p) return 42;",
+ " // implicit 'return;' is ignored",
+ "}"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
+ public void test_mixedReturnTypes_ignoreImplicit2() throws Exception {
+ Source source = addSource(createSource(//
+ "f(bool p) {",
+ " if (p) {",
+ " return 42;",
+ " } else {",
+ " return 42;",
+ " }",
+ " // implicit 'return;' is ignored",
+ "}"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
public void test_mixedReturnTypes_sameKind() throws Exception {
Source source = addSource(createSource(//
"class C {",

Powered by Google App Engine
This is Rietveld 408576698