| 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 "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 import '../../../sdk/lib/_internal/compiler/implementation/scanner/scannerlib.da
rt'; | 6 import '../../../sdk/lib/_internal/compiler/implementation/scanner/scannerlib.da
rt'; |
| 7 import '../../../sdk/lib/_internal/compiler/implementation/source_file.dart'; | 7 import '../../../sdk/lib/_internal/compiler/implementation/source_file.dart'; |
| 8 import '../../../sdk/lib/_internal/compiler/implementation/types/types.dart'; | 8 import '../../../sdk/lib/_internal/compiler/implementation/types/types.dart'; |
| 9 | 9 |
| 10 import "parser_helper.dart"; | 10 import "parser_helper.dart"; |
| (...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1328 Expect.equals( | 1328 Expect.equals( |
| 1329 inferredType(new TypedSelector.subclass( | 1329 inferredType(new TypedSelector.subclass( |
| 1330 xy.rawType, foo)).simplify(result.compiler), | 1330 xy.rawType, foo)).simplify(result.compiler), |
| 1331 new TypeMask.nonNullSubclass(bc.rawType)); | 1331 new TypeMask.nonNullSubclass(bc.rawType)); |
| 1332 | 1332 |
| 1333 Selector bar = new Selector.call(buildSourceString("bar"), null, 0); | 1333 Selector bar = new Selector.call(buildSourceString("bar"), null, 0); |
| 1334 | 1334 |
| 1335 Expect.isNull(inferredType(bar)); | 1335 Expect.isNull(inferredType(bar)); |
| 1336 } | 1336 } |
| 1337 | 1337 |
| 1338 testMixins() { |
| 1339 final String source = r""" |
| 1340 class A { |
| 1341 foo() => "abc"; |
| 1342 get x => 42; |
| 1343 } |
| 1344 class B extends Object with A { |
| 1345 bar() => foo(); |
| 1346 baz() => x; |
| 1347 } |
| 1348 main() { |
| 1349 var b = new B(); |
| 1350 var x = b.foo(); |
| 1351 var y = b.bar(); |
| 1352 var z = b.x; |
| 1353 var w = b.baz(); |
| 1354 x; y; z; w; |
| 1355 } |
| 1356 """; |
| 1357 AnalysisResult result = analyze(source); |
| 1358 result.checkNodeHasType('x', [result.string]); |
| 1359 result.checkNodeHasType('y', [result.string]); |
| 1360 result.checkNodeHasType('z', [result.int]); |
| 1361 result.checkNodeHasType('w', [result.int]); |
| 1362 } |
| 1363 |
| 1338 void main() { | 1364 void main() { |
| 1339 testDynamicBackDoor(); | 1365 testDynamicBackDoor(); |
| 1340 testVariableDeclaration(); | 1366 testVariableDeclaration(); |
| 1341 testLiterals(); | 1367 testLiterals(); |
| 1342 testRedefinition(); | 1368 testRedefinition(); |
| 1343 testIfThenElse(); | 1369 testIfThenElse(); |
| 1344 testTernaryIf(); | 1370 testTernaryIf(); |
| 1345 testWhile(); | 1371 testWhile(); |
| 1346 testFor1(); | 1372 testFor1(); |
| 1347 testFor2(); | 1373 testFor2(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 testDynamicIsAbsorbing(); | 1405 testDynamicIsAbsorbing(); |
| 1380 testLists(); | 1406 testLists(); |
| 1381 testListWithCapacity(); | 1407 testListWithCapacity(); |
| 1382 testEmptyList(); | 1408 testEmptyList(); |
| 1383 testJsCall(); | 1409 testJsCall(); |
| 1384 testIsCheck(); | 1410 testIsCheck(); |
| 1385 testSeenClasses(); | 1411 testSeenClasses(); |
| 1386 testIntDoubleNum(); | 1412 testIntDoubleNum(); |
| 1387 testConcreteTypeToTypeMask(); | 1413 testConcreteTypeToTypeMask(); |
| 1388 testSelectors(); | 1414 testSelectors(); |
| 1415 testMixins(); |
| 1389 } | 1416 } |
| OLD | NEW |