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

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

Issue 2722043002: Make TreeElementMixin._elements public to avoid out-of-library private overrides (Closed)
Patch Set: Created 3 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/secret_tree_element.dart
diff --git a/pkg/compiler/lib/src/resolution/secret_tree_element.dart b/pkg/compiler/lib/src/resolution/secret_tree_element.dart
index 635ffe77b648865ba6f613b5c760344e2207a472..2cf99641d09549a3b985c489686efe91b0ff4a08 100644
--- a/pkg/compiler/lib/src/resolution/secret_tree_element.dart
+++ b/pkg/compiler/lib/src/resolution/secret_tree_element.dart
@@ -22,8 +22,12 @@ import '../common.dart';
/// Interface for associating
abstract class TreeElementMixin {
- Object get _element;
- void set _element(Object value);
+ // We would prefer [resolutionSecretTreeElement] to be a private property, but
+ // that is a problem for DDC's separate compilation model where private
+ // overrides are disallowed.
+ // [See](https://github.com/dart-lang/sdk/issues/28809) for more context.
+ Object get resolutionSecretTreeElement;
+ void set resolutionSecretTreeElement(Object value);
}
/// Null implementation of [TreeElementMixin] which does not allow association
@@ -33,20 +37,20 @@ abstract class TreeElementMixin {
abstract class NullTreeElementMixin implements TreeElementMixin, Spannable {
// Deliberately using [Object] here to thwart code completion.
// You're not really supposed to access this field anyways.
- Object get _element => null;
- set _element(_) {
+ Object get resolutionSecretTreeElement => null;
+ set resolutionSecretTreeElement(_) {
assert(invariant(this, false,
message: "Elements cannot be associated with ${runtimeType}."));
}
}
/// Actual implementation of [TreeElementMixin] which stores the associated
-/// element in the private field [_element].
+/// element in the private field [resolutionSecretTreeElement].
///
/// This class is mixed into the node classes that are actually associated with
/// elements.
abstract class StoredTreeElementMixin implements TreeElementMixin {
- Object _element;
+ Object resolutionSecretTreeElement;
}
/**
@@ -55,12 +59,13 @@ abstract class StoredTreeElementMixin implements TreeElementMixin {
*
* Using [Object] as return type to thwart code completion.
*/
-Object getTreeElement(TreeElementMixin node) => node._element;
+Object getTreeElement(TreeElementMixin node) =>
+ node.resolutionSecretTreeElement;
/**
* Do not call this method directly. Instead, use an instance of
* TreeElements.
*/
void setTreeElement(TreeElementMixin node, Object value) {
- node._element = value;
+ node.resolutionSecretTreeElement = value;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698