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

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

Issue 2938423003: Implement override-based inference of instance fields. (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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:convert'; 6 import 'dart:convert';
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 } 500 }
501 } 501 }
502 502
503 visitVariableDeclarationList(VariableDeclarationList node) { 503 visitVariableDeclarationList(VariableDeclarationList node) {
504 super.visitVariableDeclarationList(node); 504 super.visitVariableDeclarationList(node);
505 if (node.type == null) { 505 if (node.type == null) {
506 for (VariableDeclaration variable in node.variables) { 506 for (VariableDeclaration variable in node.variables) {
507 VariableElement element = variable.element; 507 VariableElement element = variable.element;
508 if (element is LocalVariableElement) { 508 if (element is LocalVariableElement) {
509 _recordType(variable.name.offset, element.type); 509 _recordType(variable.name.offset, element.type);
510 } else { 510 } else if (!element.isStatic || element.initializer != null) {
511 _recordTopType(variable.name.offset, element.type); 511 _recordTopType(variable.name.offset, element.type);
512 } 512 }
513 } 513 }
514 } 514 }
515 } 515 }
516 516
517 bool _elementRequiresMethodDispatch(Element element) { 517 bool _elementRequiresMethodDispatch(Element element) {
518 if (element is ConstructorElement) { 518 if (element is ConstructorElement) {
519 return false; 519 return false;
520 } else if (element is ClassMemberElement) { 520 } else if (element is ClassMemberElement) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 564
565 /// Based on DDC code generator's `_recoverTypeArguments` 565 /// Based on DDC code generator's `_recoverTypeArguments`
566 Iterable<DartType> _recoverTypeArguments(FunctionType g, FunctionType f) { 566 Iterable<DartType> _recoverTypeArguments(FunctionType g, FunctionType f) {
567 assert(identical(g.element, f.element)); 567 assert(identical(g.element, f.element));
568 assert(g.typeFormals.isNotEmpty && f.typeFormals.isEmpty); 568 assert(g.typeFormals.isNotEmpty && f.typeFormals.isEmpty);
569 assert(g.typeFormals.length + g.typeArguments.length == 569 assert(g.typeFormals.length + g.typeArguments.length ==
570 f.typeArguments.length); 570 f.typeArguments.length);
571 return f.typeArguments.skip(g.typeArguments.length); 571 return f.typeArguments.skip(g.typeArguments.length);
572 } 572 }
573 } 573 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698