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 part of resolution; | 5 part of resolution; |
6 | 6 |
7 class ResolverTask extends CompilerTask { | 7 class ResolverTask extends CompilerTask { |
8 final ConstantCompiler constantCompiler; | 8 final ConstantCompiler constantCompiler; |
9 | 9 |
10 ResolverTask(Compiler compiler, this.constantCompiler) : super(compiler); | 10 ResolverTask(Compiler compiler, this.constantCompiler) : super(compiler); |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 element.supertypeLoadState = STATE_DONE; | 526 element.supertypeLoadState = STATE_DONE; |
527 element.resolutionState = STATE_DONE; | 527 element.resolutionState = STATE_DONE; |
528 // TODO(johnniwinther): Check matching type variables and | 528 // TODO(johnniwinther): Check matching type variables and |
529 // empty extends/implements clauses. | 529 // empty extends/implements clauses. |
530 } | 530 } |
531 } | 531 } |
532 | 532 |
533 void _postProcessClassElement(BaseClassElementX element) { | 533 void _postProcessClassElement(BaseClassElementX element) { |
534 for (MetadataAnnotation metadata in element.metadata) { | 534 for (MetadataAnnotation metadata in element.metadata) { |
535 metadata.ensureResolved(compiler); | 535 metadata.ensureResolved(compiler); |
536 if (!element.isProxy && | 536 ConstantValue value = |
537 metadata.constant.value == compiler.proxyConstant) { | 537 compiler.constants.getConstantValue(metadata.constant); |
| 538 if (!element.isProxy && value == compiler.proxyConstant) { |
538 element.isProxy = true; | 539 element.isProxy = true; |
539 } | 540 } |
540 } | 541 } |
541 | 542 |
542 // Force resolution of metadata on non-instance members since they may be | 543 // Force resolution of metadata on non-instance members since they may be |
543 // inspected by the backend while emitting. Metadata on instance members is | 544 // inspected by the backend while emitting. Metadata on instance members is |
544 // handled as a result of processing instantiated class members in the | 545 // handled as a result of processing instantiated class members in the |
545 // enqueuer. | 546 // enqueuer. |
546 // TODO(ahe): Avoid this eager resolution. | 547 // TODO(ahe): Avoid this eager resolution. |
547 element.forEachMember((_, Element member) { | 548 element.forEachMember((_, Element member) { |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 | 1042 |
1042 void reportDuplicateDefinition(String name, | 1043 void reportDuplicateDefinition(String name, |
1043 Spannable definition, | 1044 Spannable definition, |
1044 Spannable existing) { | 1045 Spannable existing) { |
1045 compiler.reportError(definition, | 1046 compiler.reportError(definition, |
1046 MessageKind.DUPLICATE_DEFINITION, {'name': name}); | 1047 MessageKind.DUPLICATE_DEFINITION, {'name': name}); |
1047 compiler.reportInfo(existing, | 1048 compiler.reportInfo(existing, |
1048 MessageKind.EXISTING_DEFINITION, {'name': name}); | 1049 MessageKind.EXISTING_DEFINITION, {'name': name}); |
1049 } | 1050 } |
1050 } | 1051 } |
OLD | NEW |