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

Side by Side Diff: pkg/analyzer/test/src/summary/resynthesize_ast_test.dart

Issue 2176693003: Issue a strong mode warning for type inference that is unsafe with AST-based summaries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 library analyzer.test.src.summary.resynthesize_ast_test; 5 library analyzer.test.src.summary.resynthesize_ast_test;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/element/element.dart'; 8 import 'package:analyzer/dart/element/element.dart';
9 import 'package:analyzer/src/dart/element/element.dart'; 9 import 'package:analyzer/src/dart/element/element.dart';
10 import 'package:analyzer/src/generated/engine.dart' 10 import 'package:analyzer/src/generated/engine.dart'
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 void test_invokeMethod_notGeneric_notGenericClass() { 585 void test_invokeMethod_notGeneric_notGenericClass() {
586 var unit = checkFile(r''' 586 var unit = checkFile(r'''
587 class C { 587 class C {
588 int m(int a, {String b, int c}) => null; 588 int m(int a, {String b, int c}) => null;
589 } 589 }
590 var v = new C().m(1, b: 'bbb', c: 2.0); 590 var v = new C().m(1, b: 'bbb', c: 2.0);
591 '''); 591 ''');
592 expect(unit.topLevelVariables[0].type.toString(), 'int'); 592 expect(unit.topLevelVariables[0].type.toString(), 'int');
593 } 593 }
594 594
595 @override
596 @failingTest
597 void test_unsafeBlockClosureInference_constructorCall_implicitTypeParam() {
598 super.test_unsafeBlockClosureInference_constructorCall_implicitTypeParam();
599 }
600
595 LibraryElementImpl _checkSource( 601 LibraryElementImpl _checkSource(
596 SummaryResynthesizer resynthesizer, Source source) { 602 SummaryResynthesizer resynthesizer, Source source) {
597 LibraryElementImpl resynthesized = 603 LibraryElementImpl resynthesized =
598 resynthesizer.getLibraryElement(source.uri.toString()); 604 resynthesizer.getLibraryElement(source.uri.toString());
599 LibraryElementImpl original = context.computeLibraryElement(source); 605 LibraryElementImpl original = context.computeLibraryElement(source);
600 checkLibraryElements(original, resynthesized); 606 checkLibraryElements(original, resynthesized);
601 return resynthesized; 607 return resynthesized;
602 } 608 }
603 } 609 }
604 610
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 } 746 }
741 747
742 UnlinkedUnit definingUnit = _getUnlinkedUnit(librarySource); 748 UnlinkedUnit definingUnit = _getUnlinkedUnit(librarySource);
743 LinkedLibraryBuilder linkedLibrary = 749 LinkedLibraryBuilder linkedLibrary =
744 prelink(definingUnit, getPart, getImport); 750 prelink(definingUnit, getPart, getImport);
745 linkedLibrary.dependencies.skip(1).forEach((LinkedDependency d) { 751 linkedLibrary.dependencies.skip(1).forEach((LinkedDependency d) {
746 _serializeLibrary(resolveRelativeUri(d.uri)); 752 _serializeLibrary(resolveRelativeUri(d.uri));
747 }); 753 });
748 } 754 }
749 } 755 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698