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

Unified Diff: pkg/analyzer/test/generated/analysis_context_factory.dart

Issue 2228233003: Remove false positive from override hint (issue 27046) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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
Index: pkg/analyzer/test/generated/analysis_context_factory.dart
diff --git a/pkg/analyzer/test/generated/analysis_context_factory.dart b/pkg/analyzer/test/generated/analysis_context_factory.dart
index cca5d3bdeffc8bc0211618ca8570b281f5a98fa3..f3117569db1c364d6525371c6009b9e87fe201bf 100644
--- a/pkg/analyzer/test/generated/analysis_context_factory.dart
+++ b/pkg/analyzer/test/generated/analysis_context_factory.dart
@@ -97,6 +97,8 @@ class AnalysisContextFactory {
Source coreSource = sourceFactory.forUri(DartSdk.DART_CORE);
coreContext.setContents(coreSource, "");
coreUnit.librarySource = coreUnit.source = coreSource;
+ ClassElementImpl overrideClassElement =
+ ElementFactory.classElement2("_Override");
ClassElementImpl proxyClassElement = ElementFactory.classElement2("_Proxy");
proxyClassElement.constructors = <ConstructorElement>[
ElementFactory.constructorElement(proxyClassElement, '', true)
@@ -117,6 +119,7 @@ class AnalysisContextFactory {
provider.nullType.element,
provider.numType.element,
objectClassElement,
+ overrideClassElement,
proxyClassElement,
provider.stackTraceType.element,
provider.stringType.element,
@@ -134,6 +137,9 @@ class AnalysisContextFactory {
ConstTopLevelVariableElementImpl deprecatedTopLevelVariableElt =
ElementFactory.topLevelVariableElement3(
"deprecated", true, false, provider.deprecatedType);
+ TopLevelVariableElement overrideTopLevelVariableElt =
+ ElementFactory.topLevelVariableElement3(
+ "override", true, false, overrideClassElement.type);
{
ClassElement deprecatedElement = provider.deprecatedType.element;
InstanceCreationExpression initializer = AstFactory
@@ -147,12 +153,14 @@ class AnalysisContextFactory {
deprecatedTopLevelVariableElt.constantInitializer = initializer;
}
coreUnit.accessors = <PropertyAccessorElement>[
- proxyTopLevelVariableElt.getter,
- deprecatedTopLevelVariableElt.getter
+ deprecatedTopLevelVariableElt.getter,
+ overrideTopLevelVariableElt.getter,
+ proxyTopLevelVariableElt.getter
];
coreUnit.topLevelVariables = <TopLevelVariableElement>[
- proxyTopLevelVariableElt,
- deprecatedTopLevelVariableElt
+ deprecatedTopLevelVariableElt,
+ overrideTopLevelVariableElt,
+ proxyTopLevelVariableElt
];
LibraryElementImpl coreLibrary = new LibraryElementImpl.forNode(
coreContext, AstFactory.libraryIdentifier2(["dart", "core"]));
@@ -233,7 +241,9 @@ class AnalysisContextFactory {
<TypeDefiningElement>[streamElement.typeParameters[0]],
null);
listenOnData.synthetic = true;
- List<DartType> parameterTypes = <DartType>[listenOnData.type,];
+ List<DartType> parameterTypes = <DartType>[
+ listenOnData.type,
+ ];
// TODO(brianwilkerson) This is missing the optional parameters.
MethodElementImpl listenMethod =
ElementFactory.methodElement('listen', returnType, parameterTypes);

Powered by Google App Engine
This is Rietveld 408576698