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

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

Issue 2946273002: Implement override-based type inference for instance methods. (Closed)
Patch Set: Created 3 years, 6 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/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 da235affab3fae189599da7c3d7742c26095bc53..19b79685e44449a343300abf5aed8a5460c91b86 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
@@ -455,11 +455,15 @@ class _InstrumentationVisitor extends RecursiveAstVisitor<Null> {
@override
visitMethodDeclaration(MethodDeclaration node) {
super.visitMethodDeclaration(node);
- if (node.element.enclosingElement is ClassElement) {
- if (node.isGetter && node.returnType == null) {
- _recordTopType(node.name.offset, node.element.returnType);
+ if (node.element.enclosingElement is ClassElement && !node.isStatic) {
+ if (node.returnType == null) {
+ // For now, we skip inferred return types of setters.
+ // TODO(paulberry): fix this.
+ if (!node.isSetter) {
+ _recordTopType(node.name.offset, node.element.returnType);
+ }
}
- if (node.isSetter) {
+ if (node.parameters != null) {
for (var parameter in node.parameters.parameters) {
// Note: it's tempting to check `parameter.type == null`, but that
// doesn't work because of function-typed formal parameter syntax.

Powered by Google App Engine
This is Rietveld 408576698