| OLD | NEW |
| 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 238 |
| 239 void test_infer_extractProperty_getter() { | 239 void test_infer_extractProperty_getter() { |
| 240 checkFile(r''' | 240 checkFile(r''' |
| 241 var a = 1.isEven; | 241 var a = 1.isEven; |
| 242 var b = 2.isNaN; | 242 var b = 2.isNaN; |
| 243 var c = 3.foo; | 243 var c = 3.foo; |
| 244 var d = foo.bar; | 244 var d = foo.bar; |
| 245 '''); | 245 '''); |
| 246 } | 246 } |
| 247 | 247 |
| 248 void test_infer_extractProperty_getter_sequence() { |
| 249 var unit = checkFile(r''' |
| 250 class A { |
| 251 B b = new B(); |
| 252 } |
| 253 class B { |
| 254 C c = new C(); |
| 255 } |
| 256 class C { |
| 257 int d; |
| 258 } |
| 259 var a = new A(); |
| 260 var v = a.b.c.d; |
| 261 '''); |
| 262 expect(unit.topLevelVariables[1].type.toString(), 'int'); |
| 263 } |
| 264 |
| 248 void test_infer_extractProperty_method() { | 265 void test_infer_extractProperty_method() { |
| 249 checkFile(r''' | 266 checkFile(r''' |
| 250 var a = 1.round; | 267 var a = 1.round; |
| 251 '''); | 268 '''); |
| 252 } | 269 } |
| 253 | 270 |
| 254 void test_infer_invokeConstructor_factoryRedirected() { | 271 void test_infer_invokeConstructor_factoryRedirected() { |
| 255 checkFile(r''' | 272 checkFile(r''' |
| 256 class A { | 273 class A { |
| 257 factory A() = B; | 274 factory A() = B; |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 } | 599 } |
| 583 | 600 |
| 584 UnlinkedUnit definingUnit = _getUnlinkedUnit(librarySource); | 601 UnlinkedUnit definingUnit = _getUnlinkedUnit(librarySource); |
| 585 LinkedLibraryBuilder linkedLibrary = | 602 LinkedLibraryBuilder linkedLibrary = |
| 586 prelink(definingUnit, getPart, getImport); | 603 prelink(definingUnit, getPart, getImport); |
| 587 linkedLibrary.dependencies.skip(1).forEach((LinkedDependency d) { | 604 linkedLibrary.dependencies.skip(1).forEach((LinkedDependency d) { |
| 588 _serializeLibrary(resolveRelativeUri(d.uri)); | 605 _serializeLibrary(resolveRelativeUri(d.uri)); |
| 589 }); | 606 }); |
| 590 } | 607 } |
| 591 } | 608 } |
| OLD | NEW |