| Index: dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| diff --git a/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| index 529d4b71b4ceb4e446da5716c383c55329035b31..40fcc17b7c9827ffec088f73a837bcc9c8b1e983 100644
|
| --- a/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| +++ b/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| @@ -974,6 +974,23 @@ class ResolverTask extends CompilerTask {
|
| }
|
| }
|
|
|
| +class ConstantMapper extends Visitor {
|
| + final Map<Constant, Node> constantToNodeMap = new Map<Constant, Node>();
|
| + final CompileTimeConstantEvaluator evaluator;
|
| +
|
| + ConstantMapper(ConstantHandler handler,
|
| + TreeElements elements,
|
| + Compiler compiler)
|
| + : evaluator = new CompileTimeConstantEvaluator(
|
| + handler, elements, compiler, isConst: false);
|
| +
|
| + visitNode(Node node) {
|
| + Constant constant = evaluator.evaluate(node);
|
| + if (constant != null) constantToNodeMap[constant] = node;
|
| + node.visitChildren(this);
|
| + }
|
| +}
|
| +
|
| class InitializerResolver {
|
| final ResolverVisitor visitor;
|
| final Map<Element, Node> initialized;
|
| @@ -1274,7 +1291,8 @@ class CommonResolverVisitor<R> extends Visitor<R> {
|
| }
|
|
|
| void warning(Node node, MessageKind kind, [Map arguments = const {}]) {
|
| - ResolutionWarning message = new ResolutionWarning(kind, arguments);
|
| + ResolutionWarning message =
|
| + new ResolutionWarning(kind, arguments, compiler.terseDiagnostics);
|
| compiler.reportWarning(node, message);
|
| }
|
|
|
| @@ -1750,7 +1768,8 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| SourceString name,
|
| DualKind kind,
|
| [Map arguments = const {}]) {
|
| - ResolutionWarning warning = new ResolutionWarning(kind.warning, arguments);
|
| + ResolutionWarning warning = new ResolutionWarning(
|
| + kind.warning, arguments, compiler.terseDiagnostics);
|
| compiler.reportWarning(node, warning);
|
| return new ErroneousElementX(kind.error, arguments, name, enclosingElement);
|
| }
|
| @@ -2598,6 +2617,8 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| Node selector = node.send.selector;
|
| FunctionElement constructor = resolveConstructor(node);
|
| final bool isSymbolConstructor = constructor == compiler.symbolConstructor;
|
| + final bool isMirrorsUsedConstant =
|
| + node.isConst() && (constructor == compiler.mirrorsUsedConstructor);
|
| resolveSelector(node.send, constructor);
|
| resolveArguments(node.send.argumentsNode);
|
| useElement(node.send, constructor);
|
| @@ -2650,6 +2671,8 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| }
|
| world.registerNewSymbol(mapping);
|
| }
|
| + } else if (isMirrorsUsedConstant) {
|
| + compiler.mirrorUsageAnalyzerTask.validate(node, mapping);
|
| }
|
|
|
| return null;
|
| @@ -3934,7 +3957,8 @@ class ConstructorResolver extends CommonResolverVisitor<Element> {
|
| error(diagnosticNode, kind.error, arguments);
|
| } else {
|
| ResolutionWarning warning =
|
| - new ResolutionWarning(kind.warning, arguments);
|
| + new ResolutionWarning(
|
| + kind.warning, arguments, compiler.terseDiagnostics);
|
| compiler.reportWarning(diagnosticNode, warning);
|
| return new ErroneousElementX(
|
| kind.error, arguments, targetName, enclosing);
|
|
|