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

Unified Diff: pkg/analyzer/lib/src/summary/link.dart

Issue 2757143002: The parameter of synthetic setters should inherit 'covariant'. (Closed)
Patch Set: Created 3 years, 9 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 | « pkg/analyzer/lib/src/summary/idl.dart ('k') | pkg/analyzer/lib/src/summary/summarize_ast.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/link.dart
diff --git a/pkg/analyzer/lib/src/summary/link.dart b/pkg/analyzer/lib/src/summary/link.dart
index 395a53a3b1654f9419b0edc43f1e429067c1978d..b5d770b5fe3b91fa58f75d37ff8ee9495fd7fb58 100644
--- a/pkg/analyzer/lib/src/summary/link.dart
+++ b/pkg/analyzer/lib/src/summary/link.dart
@@ -4335,6 +4335,7 @@ class PropertyAccessorElementForLink_Variable extends Object
final VariableElementForLink variable;
FunctionTypeImpl _type;
+ ParameterElementForLink_VariableSetter _parameter;
List<ParameterElement> _parameters;
PropertyAccessorElementForLink_Variable(this.variable, this.isSetter);
@@ -4378,7 +4379,8 @@ class PropertyAccessorElementForLink_Variable extends Object
if (_parameters == null) {
_parameters = <ParameterElementForLink_VariableSetter>[];
if (isSetter) {
- _parameters.add(new ParameterElementForLink_VariableSetter(this));
+ _parameter = new ParameterElementForLink_VariableSetter(this);
+ _parameters.add(_parameter);
}
}
return _parameters;
@@ -4421,7 +4423,14 @@ class PropertyAccessorElementForLink_Variable extends Object
!Identifier.isPrivateName(name) || identical(this.library, library);
@override
- void link(CompilationUnitElementInBuildUnit compilationUnit) {}
+ void link(CompilationUnitElementInBuildUnit compilationUnit) {
+ if (isSetter && _parameter != null) {
+ if (_parameter.inheritsCovariant) {
+ compilationUnit._storeInheritsCovariant(
+ variable.unlinkedVariable.inheritsCovariantSlot);
+ }
+ }
+ }
@override
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
« no previous file with comments | « pkg/analyzer/lib/src/summary/idl.dart ('k') | pkg/analyzer/lib/src/summary/summarize_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698