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

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

Issue 1437463005: Compute NewStructure in resolution. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Long line. Created 5 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: 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 461629dcdd48258793cfa28213d647a522319e08..baead69756478d8e7c1deba2bb25764fee40bcbb 100644
--- a/pkg/compiler/lib/src/resolution/access_semantics.dart
+++ b/pkg/compiler/lib/src/resolution/access_semantics.dart
@@ -392,49 +392,31 @@ class CompoundAccessSemantics extends AccessSemantics {
/// Enum representing the different kinds of destinations which a constructor
/// invocation might refer to.
enum ConstructorAccessKind {
- /// An invocation of a generative constructor.
+ /// An invocation of a (redirecting) generative constructor.
///
/// For instance
/// class C {
/// C();
+ /// C.redirect() : this();
/// }
- /// m() => new C();
+ /// m1() => new C();
+ /// m2() => new C.redirect();
///
GENERATIVE,
- /// An invocation of a redirecting generative constructor.
- ///
- /// For instance
- /// class C {
- /// C() : this._();
- /// C._();
- /// }
- /// m() => new C();
- ///
- REDIRECTING_GENERATIVE,
-
- /// An invocation of a factory constructor.
+ /// An invocation of a (redirecting) factory constructor.
///
/// For instance
/// class C {
/// factory C() => new C._();
+ /// factory C.redirect() => C._;
/// C._();
/// }
- /// m() => new C();
+ /// m1() => new C();
+ /// m2() => new C.redirect();
///
FACTORY,
- /// An invocation of a redirecting factory constructor.
- ///
- /// For instance
- /// class C {
- /// factory C() = C._;
- /// C._();
- /// }
- /// m() => new C();
- ///
- REDIRECTING_FACTORY,
-
/// An invocation of a (redirecting) generative constructor of an abstract
/// class.
///
@@ -473,17 +455,6 @@ enum ConstructorAccessKind {
///
NON_CONSTANT_CONSTRUCTOR,
- /// An invocation of an ill-defined redirecting factory constructor.
- ///
- /// For instance
- /// class C {
- /// factory C() = Unresolved;
- /// }
- /// m() => new C();
- ///
- ERRONEOUS_REDIRECTING_FACTORY,
-
-
/// An invocation of a constructor with incompatible arguments.
///
/// For instance
@@ -508,35 +479,5 @@ class ConstructorAccessSemantics {
ConstructorAccessSemantics(this.kind, this.element, this.type);
- /// The effect target of the access. Used to defined redirecting factory
- /// constructor invocations.
- ConstructorAccessSemantics get effectiveTargetSemantics => this;
-
- /// `true` if this invocation is erroneous.
- bool get isErroneous {
- return kind == ConstructorAccessKind.ABSTRACT ||
- kind == ConstructorAccessKind.UNRESOLVED_TYPE ||
- kind == ConstructorAccessKind.UNRESOLVED_CONSTRUCTOR ||
- kind == ConstructorAccessKind.NON_CONSTANT_CONSTRUCTOR ||
- 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
-/// constructor invocation.
-class RedirectingFactoryConstructorAccessSemantics
- extends ConstructorAccessSemantics {
- final ConstructorAccessSemantics effectiveTargetSemantics;
-
- RedirectingFactoryConstructorAccessSemantics(
- ConstructorAccessKind kind,
- Element element,
- DartType type,
- this.effectiveTargetSemantics)
- : super(kind, element, type);
-}
-
-

Powered by Google App Engine
This is Rietveld 408576698