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

Unified Diff: pkg/analyzer/test/src/task/strong/front_end_inference_test.dart

Issue 2919623002: Implement type inference for PropertySet. (Closed)
Patch Set: Created 3 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/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart b/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
index a523dcf44bf098070be5700bc2438491954c9a53..0d5db321665922de23708ad2bee6960fb539539f 100644
--- a/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
+++ b/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
@@ -102,6 +102,11 @@ class _ElementNamer {
String libraryName = library.name;
String name = element.name ?? '';
+ if (name.endsWith('=') &&
+ element is PropertyAccessorElement &&
+ element.isSetter) {
+ name = name.substring(0, name.length - 1);
+ }
if (libraryName != 'dart.core' &&
libraryName != 'dart.async' &&
libraryName != 'test') {
@@ -111,7 +116,8 @@ class _ElementNamer {
if (enclosing is ClassElement) {
buffer.write('${enclosing.name}::');
if (currentFactoryConstructor != null &&
- identical(enclosing, currentFactoryConstructor.enclosingElement)) {
+ identical(enclosing, currentFactoryConstructor.enclosingElement) &&
+ element is TypeParameterElement) {
String factoryConstructorName = currentFactoryConstructor.name;
if (factoryConstructorName == '') {
factoryConstructorName = '•';
@@ -143,7 +149,7 @@ class _FrontEndInferenceTest extends BaseAnalysisDriverTest {
if (validation.hasProblems) {
if (fixProblems) {
- validation.fixSource(uri);
+ validation.fixSource(uri, true);
return null;
} else {
return validation.problemsAsString;
@@ -394,7 +400,8 @@ class _InstrumentationVisitor extends RecursiveAstVisitor<Null> {
super.visitPrefixedIdentifier(node);
if (node.prefix.staticElement is! PrefixElement &&
node.prefix.staticElement is! ClassElement) {
- if (node.identifier.inGetterContext()) {
+ if (node.identifier.inGetterContext() ||
+ node.identifier.inSetterContext()) {
_recordTarget(node.identifier.offset, node.identifier.staticElement);
}
}
@@ -408,7 +415,8 @@ class _InstrumentationVisitor extends RecursiveAstVisitor<Null> {
@override
visitPropertyAccess(PropertyAccess node) {
super.visitPropertyAccess(node);
- if (node.propertyName.inGetterContext()) {
+ if (node.propertyName.inGetterContext() ||
+ node.propertyName.inSetterContext()) {
_recordTarget(node.propertyName.offset, node.propertyName.staticElement);
}
}
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698