OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // Test that computation of callers of an element works when two | 5 // Test that computation of callers of an element works when two |
6 // elements of the same name are being invoked in the same method. | 6 // elements of the same name are being invoked in the same method. |
7 | 7 |
8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
9 import "package:async_helper/async_helper.dart"; | 9 import "package:async_helper/async_helper.dart"; |
10 import '../../../sdk/lib/_internal/compiler/implementation/types/types.dart'; | 10 import 'package:compiler/implementation/types/types.dart'; |
11 import '../../../sdk/lib/_internal/compiler/implementation/inferrer/type_graph_i
nferrer.dart'; | 11 import 'package:compiler/implementation/inferrer/type_graph_inferrer.dart'; |
12 | 12 |
13 import 'compiler_helper.dart'; | 13 import 'compiler_helper.dart'; |
14 import 'parser_helper.dart'; | 14 import 'parser_helper.dart'; |
15 | 15 |
16 const String TEST = """ | 16 const String TEST = """ |
17 class A { | 17 class A { |
18 var field; | 18 var field; |
19 } | 19 } |
20 | 20 |
21 class B { | 21 class B { |
(...skipping 22 matching lines...) Expand all Loading... |
44 var mainElement = findElement(compiler, 'main'); | 44 var mainElement = findElement(compiler, 'main'); |
45 var classA = findElement(compiler, 'A'); | 45 var classA = findElement(compiler, 'A'); |
46 var fieldA = classA.lookupLocalMember('field'); | 46 var fieldA = classA.lookupLocalMember('field'); |
47 var classB = findElement(compiler, 'B'); | 47 var classB = findElement(compiler, 'B'); |
48 var fieldB = classB.lookupLocalMember('field'); | 48 var fieldB = classB.lookupLocalMember('field'); |
49 | 49 |
50 Expect.isTrue(inferrer.getCallersOf(fieldA).contains(mainElement)); | 50 Expect.isTrue(inferrer.getCallersOf(fieldA).contains(mainElement)); |
51 Expect.isTrue(inferrer.getCallersOf(fieldB).contains(mainElement)); | 51 Expect.isTrue(inferrer.getCallersOf(fieldB).contains(mainElement)); |
52 })); | 52 })); |
53 } | 53 } |
OLD | NEW |