OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 dev_compiler.src.checker.rules; | 5 library dev_compiler.src.checker.rules; |
6 | 6 |
7 import 'package:analyzer/src/generated/ast.dart'; | 7 import 'package:analyzer/src/generated/ast.dart'; |
8 import 'package:analyzer/src/generated/element.dart'; | 8 import 'package:analyzer/src/generated/element.dart'; |
9 import 'package:analyzer/src/generated/resolver.dart'; | 9 import 'package:analyzer/src/generated/resolver.dart'; |
10 | 10 |
11 import 'package:dev_compiler/src/info.dart'; | 11 import 'package:dev_compiler/src/info.dart'; |
12 import 'package:dev_compiler/src/utils.dart' as utils; | 12 import 'package:dev_compiler/src/utils.dart' as utils; |
13 import 'package:dev_compiler/strong_mode.dart' show StrongModeOptions; | 13 import 'package:dev_compiler/strong_mode.dart' show StrongModeOptions; |
14 | 14 |
15 abstract class TypeRules { | 15 abstract class TypeRules { |
16 final TypeProvider provider; | 16 final TypeProvider provider; |
17 LibraryInfo currentLibraryInfo = null; | |
18 | 17 |
19 /// Map of fields / properties / methods on Object. | 18 /// Map of fields / properties / methods on Object. |
20 final Map<String, DartType> objectMembers; | 19 final Map<String, DartType> objectMembers; |
21 | 20 |
22 TypeRules(TypeProvider provider) | 21 TypeRules(TypeProvider provider) |
23 : provider = provider, | 22 : provider = provider, |
24 objectMembers = utils.getObjectMemberMap(provider); | 23 objectMembers = utils.getObjectMemberMap(provider); |
25 | 24 |
26 MissingTypeReporter reportMissingType; | 25 MissingTypeReporter reportMissingType; |
27 | 26 |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 var entries = e.entries; | 776 var entries = e.entries; |
778 bool inferEntry(MapLiteralEntry entry) { | 777 bool inferEntry(MapLiteralEntry entry) { |
779 return _inferExpression(entry.key, kType, errors) && | 778 return _inferExpression(entry.key, kType, errors) && |
780 _inferExpression(entry.value, vType, errors); | 779 _inferExpression(entry.value, vType, errors); |
781 } | 780 } |
782 var b = entries.every(inferEntry); | 781 var b = entries.every(inferEntry); |
783 if (b) annotateMapLiteral(e, targs); | 782 if (b) annotateMapLiteral(e, targs); |
784 return b; | 783 return b; |
785 } | 784 } |
786 } | 785 } |
OLD | NEW |