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

Unified Diff: pkg/compiler/lib/src/resolution/access_semantics.dart

Issue 1161823004: Handle .fromEnvironment and incompatible constructor invocations (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Change handling of incompatible redirecting factories. Created 5 years, 7 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: pkg/compiler/lib/src/resolution/access_semantics.dart
diff --git a/pkg/compiler/lib/src/resolution/access_semantics.dart b/pkg/compiler/lib/src/resolution/access_semantics.dart
index 0e1be6f2942efbcbc3a813aa84da49f734c57f5e..17ec4adabc49af4aee3af3b32485884feadcf0a1 100644
--- a/pkg/compiler/lib/src/resolution/access_semantics.dart
+++ b/pkg/compiler/lib/src/resolution/access_semantics.dart
@@ -474,6 +474,17 @@ enum ConstructorAccessKind {
/// m() => new C();
///
ERRONEOUS_REDIRECTING_FACTORY,
+
+
+ /// An invocation of a constructor with incompatible arguments.
+ ///
+ /// For instance
+ /// class C {
+ /// C();
+ /// }
+ /// m() => new C(true);
+ ///
+ INCOMPATIBLE,
}
/// Data structure used to classify the semantics of a constructor invocation.
@@ -499,8 +510,11 @@ class ConstructorAccessSemantics {
kind == ConstructorAccessKind.UNRESOLVED_TYPE ||
kind == ConstructorAccessKind.UNRESOLVED_CONSTRUCTOR ||
kind == ConstructorAccessKind.NON_CONSTANT_CONSTRUCTOR ||
- kind == ConstructorAccessKind.ERRONEOUS_REDIRECTING_FACTORY;
+ kind == ConstructorAccessKind.ERRONEOUS_REDIRECTING_FACTORY ||
+ kind == ConstructorAccessKind.INCOMPATIBLE;
}
+
+ String toString() => 'ConstructorAccessSemantics($kind, $element, $type)';
}
/// Data structure used to classify the semantics of a redirecting factory
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | pkg/compiler/lib/src/resolution/semantic_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698