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

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: Address code review comments. 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_closureCall() {
598 super.test_unsafeBlockClosureInference_closureCall();
599 }
600
601 @override
602 @failingTest
603 void test_unsafeBlockClosureInference_constructorCall_implicitTypeParam() {
604 super.test_unsafeBlockClosureInference_constructorCall_implicitTypeParam();
605 }
606
607 @override
608 @failingTest
609 void
610 test_unsafeBlockClosureInference_functionCall_explicitDynamicParam_viaExpr 2() {
611 super
612 .test_unsafeBlockClosureInference_functionCall_explicitDynamicParam_viaE xpr2();
613 }
614
615 @override
616 @failingTest
617 void
618 test_unsafeBlockClosureInference_functionCall_explicitTypeParam_viaExpr2() {
619 super
620 .test_unsafeBlockClosureInference_functionCall_explicitTypeParam_viaExpr 2();
621 }
622
623 @override
624 @failingTest
625 void test_unsafeBlockClosureInference_functionCall_implicitTypeParam() {
626 super.test_unsafeBlockClosureInference_functionCall_implicitTypeParam();
627 }
628
629 @override
630 @failingTest
631 void
632 test_unsafeBlockClosureInference_functionCall_implicitTypeParam_viaExpr() {
633 super
634 .test_unsafeBlockClosureInference_functionCall_implicitTypeParam_viaExpr ();
635 }
636
637 @override
638 @failingTest
639 void test_unsafeBlockClosureInference_functionCall_noTypeParam_viaExpr() {
640 super.test_unsafeBlockClosureInference_functionCall_noTypeParam_viaExpr();
641 }
642
643 @override
644 @failingTest
645 void test_unsafeBlockClosureInference_inList_untyped() {
646 super.test_unsafeBlockClosureInference_inList_untyped();
647 }
648
649 @override
650 @failingTest
651 void test_unsafeBlockClosureInference_inMap_untyped() {
652 super.test_unsafeBlockClosureInference_inMap_untyped();
653 }
654
655 @override
656 @failingTest
657 void test_unsafeBlockClosureInference_methodCall_implicitTypeParam() {
658 super.test_unsafeBlockClosureInference_methodCall_implicitTypeParam();
659 }
660
595 LibraryElementImpl _checkSource( 661 LibraryElementImpl _checkSource(
596 SummaryResynthesizer resynthesizer, Source source) { 662 SummaryResynthesizer resynthesizer, Source source) {
597 LibraryElementImpl resynthesized = 663 LibraryElementImpl resynthesized =
598 resynthesizer.getLibraryElement(source.uri.toString()); 664 resynthesizer.getLibraryElement(source.uri.toString());
599 LibraryElementImpl original = context.computeLibraryElement(source); 665 LibraryElementImpl original = context.computeLibraryElement(source);
600 checkLibraryElements(original, resynthesized); 666 checkLibraryElements(original, resynthesized);
601 return resynthesized; 667 return resynthesized;
602 } 668 }
603 } 669 }
604 670
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 } 806 }
741 807
742 UnlinkedUnit definingUnit = _getUnlinkedUnit(librarySource); 808 UnlinkedUnit definingUnit = _getUnlinkedUnit(librarySource);
743 LinkedLibraryBuilder linkedLibrary = 809 LinkedLibraryBuilder linkedLibrary =
744 prelink(definingUnit, getPart, getImport); 810 prelink(definingUnit, getPart, getImport);
745 linkedLibrary.dependencies.skip(1).forEach((LinkedDependency d) { 811 linkedLibrary.dependencies.skip(1).forEach((LinkedDependency d) {
746 _serializeLibrary(resolveRelativeUri(d.uri)); 812 _serializeLibrary(resolveRelativeUri(d.uri));
747 }); 813 });
748 } 814 }
749 } 815 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698