| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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:uri"; | 5 import "dart:uri"; |
| 6 import "../../../lib/compiler/implementation/elements/elements.dart"; | 6 import "../../../lib/compiler/implementation/elements/elements.dart"; |
| 7 import '../../../lib/compiler/implementation/scanner/scannerlib.dart'; | 7 import '../../../lib/compiler/implementation/scanner/scannerlib.dart'; |
| 8 import '../../../lib/compiler/implementation/source_file.dart'; | 8 import '../../../lib/compiler/implementation/source_file.dart'; |
| 9 import '../../../lib/compiler/implementation/types/types.dart'; | 9 import '../../../lib/compiler/implementation/types/types.dart'; |
| 10 import '../../../lib/compiler/implementation/tree/tree.dart'; | 10 import '../../../lib/compiler/implementation/tree/tree.dart'; |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 result.checkFieldHasType('A', 'x', [result.int, result.bool]); | 252 result.checkFieldHasType('A', 'x', [result.int, result.bool]); |
| 253 result.checkFieldHasType('A', 'y', [result.string, new NullBaseType()]); | 253 result.checkFieldHasType('A', 'y', [result.string, new NullBaseType()]); |
| 254 result.checkFieldHasType('A', 'z', [result.string]); | 254 result.checkFieldHasType('A', 'z', [result.string]); |
| 255 } | 255 } |
| 256 | 256 |
| 257 testGetters() { | 257 testGetters() { |
| 258 final String source = r""" | 258 final String source = r""" |
| 259 class A { | 259 class A { |
| 260 var x; | 260 var x; |
| 261 A(this.x); | 261 A(this.x); |
| 262 get y() => x; | 262 get y => x; |
| 263 } | 263 } |
| 264 main() { | 264 main() { |
| 265 var a = new A(42); | 265 var a = new A(42); |
| 266 var foo = a.x; | 266 var foo = a.x; |
| 267 var bar = a.y; | 267 var bar = a.y; |
| 268 foo; bar; | 268 foo; bar; |
| 269 } | 269 } |
| 270 """; | 270 """; |
| 271 AnalysisResult result = analyze(source); | 271 AnalysisResult result = analyze(source); |
| 272 result.checkNodeHasType('foo', [result.int]); | 272 result.checkNodeHasType('foo', [result.int]); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 testMutuallyRecusiveFunction(); | 385 testMutuallyRecusiveFunction(); |
| 386 testConstructor(); | 386 testConstructor(); |
| 387 testGetters(); | 387 testGetters(); |
| 388 testSetters(); | 388 testSetters(); |
| 389 testNamedParameters(); | 389 testNamedParameters(); |
| 390 testListLiterals(); | 390 testListLiterals(); |
| 391 testMapLiterals(); | 391 testMapLiterals(); |
| 392 testReturn(); | 392 testReturn(); |
| 393 // testNoReturn(); // right now we infer the empty type instead of null | 393 // testNoReturn(); // right now we infer the empty type instead of null |
| 394 } | 394 } |
| OLD | NEW |