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

Unified Diff: pkg/compiler/lib/src/elements/modelx.dart

Issue 2987783002: Additional fixes for invalid overrides in dart2js (Closed)
Patch Set: Created 3 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:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/namer_names.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/elements/modelx.dart
diff --git a/pkg/compiler/lib/src/elements/modelx.dart b/pkg/compiler/lib/src/elements/modelx.dart
index 58672556603457beb38e8bd19d19649b158e24e8..f48475e92c392f39b9bdd207b35f9ac437a54ac8 100644
--- a/pkg/compiler/lib/src/elements/modelx.dart
+++ b/pkg/compiler/lib/src/elements/modelx.dart
@@ -250,8 +250,8 @@ class ErroneousElementX extends ElementX
get functionSignature => unsupported();
get parameterStructure => unsupported();
get parameters => unsupported();
- Element get patch => null;
- Element get origin => this;
+ FunctionElement get patch => null;
+ FunctionElement get origin => this;
get immediateRedirectionTarget => unsupported();
get nestedClosures => unsupported();
get memberContext => unsupported();
@@ -3554,9 +3554,8 @@ class ParameterMetadataAnnotation extends MetadataAnnotationX {
///
/// See `patch_parser.dart` for a description of the terminology.
abstract class PatchMixin<E extends Element> implements Element {
- // TODO(johnniwinther): Use type variables.
- Element /* E */ patch = null;
- Element /* E */ origin = null;
+ E patch = null;
+ E origin = null;
bool get isPatch => origin != null;
bool get isPatched => patch != null;
@@ -3564,8 +3563,8 @@ abstract class PatchMixin<E extends Element> implements Element {
bool get isImplementation => !isPatched;
bool get isDeclaration => !isPatch;
- Element /* E */ get implementation => isPatched ? patch : this;
- Element /* E */ get declaration => isPatch ? origin : this;
+ E get implementation => isPatched ? patch : this;
+ E get declaration => isPatch ? origin : this;
/// Applies a patch to this element. This method must be called at most once.
void applyPatch(PatchMixin<E> patch) {
@@ -3573,7 +3572,9 @@ abstract class PatchMixin<E extends Element> implements Element {
assert(this.origin == null, failedAt(this, "Origin element is a patch."));
assert(patch.origin == null, failedAt(patch, "Element is patched twice."));
assert(patch.patch == null, failedAt(patch, "Patch element is patched."));
+ // ignore: INVALID_ASSIGNMENT
this.patch = patch;
Siggi Cherem (dart-lang) 2017/07/24 23:02:23 the alternative is to add `as E` here. I might wan
+ // ignore: INVALID_ASSIGNMENT
patch.origin = this;
}
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/namer_names.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698