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

Unified Diff: pkg/analyzer/test/generated/resolver_test.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 360393003: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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:
Download patch
« no previous file with comments | « pkg/analyzer/test/generated/element_test.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/resolver_test.dart
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index dd5e771641012e5e91d79be26b8a318711cbd228..3879cf3a013c600b12a1b882f9b0bc4e744b3d94 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -10184,6 +10184,27 @@ class MemberMapTest extends JUnitTestCase {
}
class NonErrorResolverTest extends ResolverTestCase {
+ void fail_invalidAssignment_implicitlyImplementFunctionViaCall_2() {
+ // 18341
+ //
+ // Here 'C' checks as a subtype of 'I', but 'C' does not
+ // check as a subtype of 'IntToInt'. Together with
+ // 'test_invalidAssignment_implicitlyImplementFunctionViaCall_1()' we see
+ // that subtyping is not transitive here.
+ Source source = addSource(EngineTestCase.createSource([
+ "class I {",
+ " int call(int x) => 0;",
+ "}",
+ "class C implements I {",
+ " noSuchMethod(_) => null;",
+ "}",
+ "typedef int IntToInt(int x);",
+ "IntToInt f = new C();"]));
+ resolve(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
void test_ambiguousExport() {
Source source = addSource(EngineTestCase.createSource([
"library L;",
@@ -11781,6 +11802,44 @@ class NonErrorResolverTest extends ResolverTestCase {
verify([source]);
}
+ void test_invalidAssignment_implicitlyImplementFunctionViaCall_1() {
+ // 18341
+ //
+ // This test and 'fail/test_invalidAssignment_implicitlyImplementFunctionViaCall_2()'
+ // are closely related: here we see that 'I' checks as a subtype of 'IntToInt'.
+ Source source = addSource(EngineTestCase.createSource([
+ "class I {",
+ " int call(int x) => 0;",
+ "}",
+ "class C implements I {",
+ " noSuchMethod(_) => null;",
+ "}",
+ "typedef int IntToInt(int x);",
+ "IntToInt f = new I();"]));
+ resolve(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
+ void test_invalidAssignment_implicitlyImplementFunctionViaCall_3() {
+ // 18341
+ //
+ // Like 'fail/test_invalidAssignment_implicitlyImplementFunctionViaCall_2()',
+ // but uses type 'Function' instead of more precise type 'IntToInt' for 'f'.
+ Source source = addSource(EngineTestCase.createSource([
+ "class I {",
+ " int call(int x) => 0;",
+ "}",
+ "class C implements I {",
+ " noSuchMethod(_) => null;",
+ "}",
+ "typedef int IntToInt(int x);",
+ "Function f = new C();"]));
+ resolve(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
void test_invalidAssignment_toDynamic() {
Source source = addSource(EngineTestCase.createSource(["f() {", " var g;", " g = () => 0;", "}"]));
resolve(source);
@@ -14691,6 +14750,14 @@ class NonErrorResolverTest extends ResolverTestCase {
final __test = new NonErrorResolverTest();
runJUnitTest(__test, __test.test_invalidAssignment_defaultValue_optional);
});
+ _ut.test('test_invalidAssignment_implicitlyImplementFunctionViaCall_1', () {
+ final __test = new NonErrorResolverTest();
+ runJUnitTest(__test, __test.test_invalidAssignment_implicitlyImplementFunctionViaCall_1);
+ });
+ _ut.test('test_invalidAssignment_implicitlyImplementFunctionViaCall_3', () {
+ final __test = new NonErrorResolverTest();
+ runJUnitTest(__test, __test.test_invalidAssignment_implicitlyImplementFunctionViaCall_3);
+ });
_ut.test('test_invalidAssignment_toDynamic', () {
final __test = new NonErrorResolverTest();
runJUnitTest(__test, __test.test_invalidAssignment_toDynamic);
@@ -27955,6 +28022,22 @@ class TypeResolverVisitorTest extends EngineTestCase {
}
main() {
+// DeclarationMatcherTest.dartSuite();
+// ElementResolverTest.dartSuite();
+// IncrementalResolverTest.dartSuite();
+// InheritanceManagerTest.dartSuite();
+// LibraryElementBuilderTest.dartSuite();
+// LibraryTest.dartSuite();
+// StaticTypeAnalyzerTest.dartSuite();
+// SubtypeManagerTest.dartSuite();
+// TypeOverrideManagerTest.dartSuite();
+// TypeProviderImplTest.dartSuite();
+// TypeResolverVisitorTest.dartSuite();
+// EnclosedScopeTest.dartSuite();
+// LibraryImportScopeTest.dartSuite();
+// LibraryScopeTest.dartSuite();
+// ScopeBuilderTest.dartSuite();
+// ScopeTest.dartSuite();
// CompileTimeErrorCodeTest.dartSuite();
// ErrorResolverTest.dartSuite();
// HintCodeTest.dartSuite();
@@ -27966,22 +28049,6 @@ main() {
// StaticWarningCodeTest.dartSuite();
// StrictModeTest.dartSuite();
// TypePropagationTest.dartSuite();
-// EnclosedScopeTest.dartSuite();
-// LibraryImportScopeTest.dartSuite();
-// LibraryScopeTest.dartSuite();
-// ScopeBuilderTest.dartSuite();
-// ScopeTest.dartSuite();
// //AnalysisDeltaTest.dartSuite();
// ChangeSetTest.dartSuite();
-// DeclarationMatcherTest.dartSuite();
-// ElementResolverTest.dartSuite();
-// IncrementalResolverTest.dartSuite();
-// InheritanceManagerTest.dartSuite();
-// LibraryElementBuilderTest.dartSuite();
-// LibraryTest.dartSuite();
-// StaticTypeAnalyzerTest.dartSuite();
-// SubtypeManagerTest.dartSuite();
-// TypeOverrideManagerTest.dartSuite();
-// TypeProviderImplTest.dartSuite();
-// TypeResolverVisitorTest.dartSuite();
}
« no previous file with comments | « pkg/analyzer/test/generated/element_test.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698