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

Unified Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 2015963002: Resynthesize ParameterElementImpl.parameterKind lazily. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/resynthesize.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/element/element.dart
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index d407317ca9a387796d8cb3b4fde008baedbf31a0..edab53970d7cdcda8a5918a00ad45ad44d433d43 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -5778,7 +5778,7 @@ class ParameterElementImpl extends VariableElementImpl
/**
* The kind of this parameter.
*/
- ParameterKind parameterKind;
+ ParameterKind _parameterKind;
/**
* The Dart code of the default value.
@@ -5948,6 +5948,29 @@ class ParameterElementImpl extends VariableElementImpl
}
@override
+ ParameterKind get parameterKind {
+ if (_unlinkedParam != null && _parameterKind == null) {
+ switch (_unlinkedParam.kind) {
+ case UnlinkedParamKind.named:
+ _parameterKind = ParameterKind.NAMED;
+ break;
+ case UnlinkedParamKind.positional:
+ _parameterKind = ParameterKind.POSITIONAL;
+ break;
+ case UnlinkedParamKind.required:
+ _parameterKind = ParameterKind.REQUIRED;
+ break;
+ }
+ }
+ return _parameterKind;
+ }
+
+ void set parameterKind(ParameterKind parameterKind) {
+ assert(_unlinkedParam == null);
+ _parameterKind = parameterKind;
+ }
+
+ @override
List<ParameterElement> get parameters => _parameters;
/**
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/resynthesize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698