| Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| index 2e6ae95ab226867f084c913802a7ad0f9f556cb9..f71f9154a72e1548ddd2cc488f5bbf2ab5190d9f 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| @@ -85,15 +85,15 @@ class TreeElementMapping implements TreeElements {
|
| assert(invariant(node, () {
|
| FunctionExpression functionExpression = node.asFunctionExpression();
|
| if (functionExpression != null) {
|
| - return !functionExpression.modifiers.isExternal();
|
| + return !functionExpression.modifiers.isExternal;
|
| }
|
| return true;
|
| }));
|
| // TODO(johnniwinther): Simplify this invariant to use only declarations in
|
| // [TreeElements].
|
| assert(invariant(node, () {
|
| - if (!element.isErroneous() && currentElement != null && element.isPatch) {
|
| - return currentElement.getImplementationLibrary().isPatch;
|
| + if (!element.isErroneous && currentElement != null && element.isPatch) {
|
| + return currentElement.implementationLibrary.isPatch;
|
| }
|
| return true;
|
| }));
|
| @@ -273,11 +273,11 @@ class ResolverTask extends CompilerTask {
|
|
|
| if (identical(kind, ElementKind.FIELD)) return resolveField(element);
|
|
|
| - if (element.isClass()) {
|
| + if (element.isClass) {
|
| ClassElement cls = element;
|
| cls.ensureResolved(compiler);
|
| return null;
|
| - } else if (element.isTypedef()) {
|
| + } else if (element.isTypedef) {
|
| TypedefElement typdef = element;
|
| return resolveTypedef(typdef);
|
| }
|
| @@ -437,7 +437,7 @@ class ResolverTask extends CompilerTask {
|
| if (elements != null) {
|
| // TODO(karlklose): Remove the check for [isConstructor]. [elememts]
|
| // should never be non-null, not even for constructors.
|
| - assert(invariant(element, element.isConstructor(),
|
| + assert(invariant(element, element.isConstructor,
|
| message: 'Non-constructor element $element '
|
| 'has already been analyzed.'));
|
| return elements;
|
| @@ -450,13 +450,13 @@ class ResolverTask extends CompilerTask {
|
| // resolved. This is the only place where the resolver is
|
| // seeing this element.
|
| element.computeSignature(compiler);
|
| - if (!target.isErroneous()) {
|
| + if (!target.isErroneous) {
|
| compiler.enqueuer.resolution.registerStaticUse(target);
|
| compiler.world.registerImplicitSuperCall(elements, target);
|
| }
|
| return elements;
|
| } else {
|
| - assert(element.isDeferredLoaderGetter());
|
| + assert(element.isDeferredLoaderGetter);
|
| return _ensureTreeElements(element);
|
| }
|
| }
|
| @@ -473,15 +473,15 @@ class ResolverTask extends CompilerTask {
|
| }
|
| return compiler.withCurrentElement(element, () {
|
| FunctionExpression tree = element.node;
|
| - if (tree.modifiers.isExternal()) {
|
| + if (tree.modifiers.isExternal) {
|
| error(tree, MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION);
|
| return null;
|
| }
|
| - if (isConstructor || element.isFactoryConstructor()) {
|
| + if (isConstructor || element.isFactoryConstructor) {
|
| if (tree.returnType != null) {
|
| error(tree, MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE);
|
| }
|
| - if (element.modifiers.isConst() &&
|
| + if (element.modifiers.isConst &&
|
| tree.hasBody() &&
|
| !tree.isRedirectingFactory) {
|
| compiler.reportError(tree, MessageKind.CONST_CONSTRUCTOR_HAS_BODY);
|
| @@ -519,7 +519,7 @@ class ResolverTask extends CompilerTask {
|
| // happens when a function is resolved after the mixin
|
| // application has been performed.
|
| TreeElements resolutionTree = visitor.mapping;
|
| - ClassElement enclosingClass = element.getEnclosingClass();
|
| + ClassElement enclosingClass = element.enclosingClass;
|
| if (enclosingClass != null) {
|
| Set<MixinApplicationElement> mixinUses =
|
| compiler.world.mixinUses[enclosingClass];
|
| @@ -543,7 +543,7 @@ class ResolverTask extends CompilerTask {
|
|
|
| TreeElements resolveField(VariableElementX element) {
|
| VariableDefinitions tree = element.parseNode(compiler);
|
| - if(element.modifiers.isStatic() && element.isTopLevel()) {
|
| + if(element.modifiers.isStatic && element.isTopLevel) {
|
| error(element.modifiers.getStatic(),
|
| MessageKind.TOP_LEVEL_VARIABLE_DECLARED_STATIC);
|
| }
|
| @@ -563,9 +563,9 @@ class ResolverTask extends CompilerTask {
|
| // TODO(johnniwinther): Avoid analyzing initializers if
|
| // [Compiler.analyzeSignaturesOnly] is set.
|
| visitor.visit(initializer);
|
| - } else if (modifiers.isConst()) {
|
| + } else if (modifiers.isConst) {
|
| compiler.reportError(element, MessageKind.CONST_WITHOUT_INITIALIZER);
|
| - } else if (modifiers.isFinal() && !element.isInstanceMember()) {
|
| + } else if (modifiers.isFinal && !element.isInstanceMember) {
|
| compiler.reportError(element, MessageKind.FINAL_WITHOUT_INITIALIZER);
|
| } else {
|
| compiler.enqueuer.resolution.registerInstantiatedClass(
|
| @@ -574,14 +574,14 @@ class ResolverTask extends CompilerTask {
|
|
|
| if (Elements.isStaticOrTopLevelField(element)) {
|
| visitor.addDeferredAction(element, () {
|
| - if (element.modifiers.isConst()) {
|
| + if (element.modifiers.isConst) {
|
| constantCompiler.compileConstant(element);
|
| } else {
|
| constantCompiler.compileVariable(element);
|
| }
|
| });
|
| if (initializer != null) {
|
| - if (!element.modifiers.isConst()) {
|
| + if (!element.modifiers.isConst) {
|
| // TODO(johnniwinther): Determine the const-ness eagerly to avoid
|
| // unnecessary registrations.
|
| compiler.backend.registerLazyField(visitor.mapping);
|
| @@ -640,7 +640,7 @@ class ResolverTask extends CompilerTask {
|
|
|
| if (targetType == null) {
|
| assert(!target.isRedirectingFactory);
|
| - targetType = target.getEnclosingClass().thisType;
|
| + targetType = target.enclosingClass.thisType;
|
| }
|
|
|
| // [target] is now the actual target of the redirections. Run through
|
| @@ -825,7 +825,7 @@ class ResolverTask extends CompilerTask {
|
| // enqueuer.
|
| // TODO(ahe): Avoid this eager resolution.
|
| element.forEachMember((_, Element member) {
|
| - if (!member.isInstanceMember()) {
|
| + if (!member.isInstanceMember) {
|
| compiler.withCurrentElement(member, () {
|
| for (MetadataAnnotation metadata in member.metadata) {
|
| metadata.ensureResolved(compiler);
|
| @@ -887,7 +887,7 @@ class ResolverTask extends CompilerTask {
|
| // Check that the mixed in class doesn't have any constructors and
|
| // make sure we aren't mixing in methods that use 'super'.
|
| mixin.forEachLocalMember((Element member) {
|
| - if (member.isGenerativeConstructor() && !member.isSynthesized) {
|
| + if (member.isGenerativeConstructor && !member.isSynthesized) {
|
| compiler.reportError(member, MessageKind.ILLEGAL_MIXIN_CONSTRUCTOR);
|
| } else {
|
| // Get the resolution tree and check that the resolved member
|
| @@ -932,11 +932,11 @@ class ResolverTask extends CompilerTask {
|
| member.computeType(compiler);
|
|
|
| // Check modifiers.
|
| - if (member.isFunction() && member.modifiers.isFinal()) {
|
| + if (member.isFunction && member.modifiers.isFinal) {
|
| compiler.reportError(
|
| member, MessageKind.ILLEGAL_FINAL_METHOD_MODIFIER);
|
| }
|
| - if (member.isConstructor()) {
|
| + if (member.isConstructor) {
|
| final mismatchedFlagsBits =
|
| member.modifiers.flags &
|
| (Modifiers.FLAG_STATIC | Modifiers.FLAG_ABSTRACT);
|
| @@ -948,13 +948,13 @@ class ResolverTask extends CompilerTask {
|
| MessageKind.ILLEGAL_CONSTRUCTOR_MODIFIERS,
|
| {'modifiers': mismatchedFlags});
|
| }
|
| - if (member.modifiers.isConst()) {
|
| + if (member.modifiers.isConst) {
|
| constConstructors.add(member);
|
| }
|
| }
|
| - if (member.isField()) {
|
| - if (!member.modifiers.isStatic() &&
|
| - !member.modifiers.isFinal()) {
|
| + if (member.isField) {
|
| + if (!member.modifiers.isStatic &&
|
| + !member.modifiers.isFinal) {
|
| nonFinalInstanceFields.add(member);
|
| }
|
| }
|
| @@ -985,10 +985,10 @@ class ResolverTask extends CompilerTask {
|
| // Only check for getters. The test can only fail if there is both a setter
|
| // and a getter with the same name, and we only need to check each abstract
|
| // field once, so we just ignore setters.
|
| - if (!member.isGetter()) return;
|
| + if (!member.isGetter) return;
|
|
|
| // Find the associated abstract field.
|
| - ClassElement classElement = member.getEnclosingClass();
|
| + ClassElement classElement = member.enclosingClass;
|
| Element lookupElement = classElement.lookupLocalMember(member.name);
|
| if (lookupElement == null) {
|
| compiler.internalError(member,
|
| @@ -1054,7 +1054,7 @@ class ResolverTask extends CompilerTask {
|
|
|
| void checkOverrideHashCode(FunctionElement operatorEquals) {
|
| if (operatorEquals.isAbstract) return;
|
| - ClassElement cls = operatorEquals.getEnclosingClass();
|
| + ClassElement cls = operatorEquals.enclosingClass;
|
| Element hashCodeImplementation =
|
| cls.lookupLocalMember('hashCode');
|
| if (hashCodeImplementation != null) return;
|
| @@ -1127,14 +1127,14 @@ class ResolverTask extends CompilerTask {
|
| errorneousElement,
|
| errorMessage,
|
| {'memberName': contextElement.name,
|
| - 'className': contextElement.getEnclosingClass().name});
|
| + 'className': contextElement.enclosingClass.name});
|
| compiler.reportInfo(contextElement, contextMessage);
|
| }
|
|
|
|
|
| FunctionSignature resolveSignature(FunctionElementX element) {
|
| MessageKind defaultValuesError = null;
|
| - if (element.isFactoryConstructor()) {
|
| + if (element.isFactoryConstructor) {
|
| FunctionExpression body = element.parseNode(compiler);
|
| if (body.isRedirectingFactory) {
|
| defaultValuesError = MessageKind.REDIRECTING_FACTORY_WITH_DEFAULT;
|
| @@ -1253,7 +1253,7 @@ class InitializerResolver {
|
| String name = field.name;
|
| if (initialized.containsKey(field)) {
|
| reportDuplicateInitializerError(field, init, initialized[field]);
|
| - } else if (field.modifiers.isFinal()) {
|
| + } else if (field.modifiers.isFinal) {
|
| field.parseNode(visitor.compiler);
|
| Expression initializer = field.initializer;
|
| if (initializer != null) {
|
| @@ -1270,12 +1270,12 @@ class InitializerResolver {
|
| // Lookup target field.
|
| Element target;
|
| if (isFieldInitializer(init)) {
|
| - target = constructor.getEnclosingClass().lookupLocalMember(name);
|
| + target = constructor.enclosingClass.lookupLocalMember(name);
|
| if (target == null) {
|
| error(selector, MessageKind.CANNOT_RESOLVE, {'name': name});
|
| } else if (target.kind != ElementKind.FIELD) {
|
| error(selector, MessageKind.NOT_A_FIELD, {'fieldName': name});
|
| - } else if (!target.isInstanceMember()) {
|
| + } else if (!target.isInstanceMember) {
|
| error(selector, MessageKind.INIT_STATIC_FIELD, {'fieldName': name});
|
| }
|
| } else {
|
| @@ -1291,7 +1291,7 @@ class InitializerResolver {
|
| ClassElement getSuperOrThisLookupTarget(FunctionElement constructor,
|
| bool isSuperCall,
|
| Node diagnosticNode) {
|
| - ClassElement lookupTarget = constructor.getEnclosingClass();
|
| + ClassElement lookupTarget = constructor.enclosingClass;
|
| if (isSuperCall) {
|
| // Calculate correct lookup target and constructor name.
|
| if (identical(lookupTarget, visitor.compiler.objectClass)) {
|
| @@ -1341,7 +1341,7 @@ class InitializerResolver {
|
| void resolveImplicitSuperConstructorSend(FunctionElement constructor,
|
| FunctionExpression functionNode) {
|
| // If the class has a super resolve the implicit super call.
|
| - ClassElement classElement = constructor.getEnclosingClass();
|
| + ClassElement classElement = constructor.enclosingClass;
|
| ClassElement superClass = classElement.superclass;
|
| if (classElement != visitor.compiler.objectClass) {
|
| assert(superClass != null);
|
| @@ -1349,7 +1349,7 @@ class InitializerResolver {
|
| String constructorName = '';
|
| Selector callToMatch = new Selector.call(
|
| constructorName,
|
| - classElement.getLibrary(),
|
| + classElement.library,
|
| 0);
|
|
|
| final bool isSuperCall = true;
|
| @@ -1357,7 +1357,7 @@ class InitializerResolver {
|
| isSuperCall,
|
| functionNode);
|
| Selector constructorSelector = new Selector.callDefaultConstructor(
|
| - visitor.enclosingElement.getLibrary());
|
| + visitor.enclosingElement.library);
|
| Element calledConstructor = lookupTarget.lookupConstructor(
|
| constructorSelector);
|
|
|
| @@ -1385,7 +1385,7 @@ class InitializerResolver {
|
| String className,
|
| Selector constructorSelector) {
|
| if (lookedupConstructor == null
|
| - || !lookedupConstructor.isGenerativeConstructor()) {
|
| + || !lookedupConstructor.isGenerativeConstructor) {
|
| var fullConstructorName =
|
| visitor.compiler.resolver.constructorNameForDiagnostics(
|
| className,
|
| @@ -1401,8 +1401,8 @@ class InitializerResolver {
|
| ? MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT
|
| : MessageKind.NO_MATCHING_CONSTRUCTOR;
|
| visitor.compiler.reportError(diagnosticNode, kind);
|
| - } else if (caller.modifiers.isConst()
|
| - && !lookedupConstructor.modifiers.isConst()) {
|
| + } else if (caller.modifiers.isConst
|
| + && !lookedupConstructor.modifiers.isConst) {
|
| visitor.compiler.reportError(
|
| diagnosticNode, MessageKind.CONST_CALLS_NON_CONST);
|
| }
|
| @@ -1453,7 +1453,7 @@ class InitializerResolver {
|
| // Check that there is no body (Language specification 7.5.1). If the
|
| // constructor is also const, we already reported an error in
|
| // [resolveMethodElement].
|
| - if (functionNode.hasBody() && !constructor.modifiers.isConst()) {
|
| + if (functionNode.hasBody() && !constructor.modifiers.isConst) {
|
| error(functionNode, MessageKind.REDIRECTING_CONSTRUCTOR_HAS_BODY);
|
| }
|
| // Check that there are no other initializers.
|
| @@ -1464,7 +1464,7 @@ class InitializerResolver {
|
| Compiler compiler = visitor.compiler;
|
| FunctionSignature signature = constructor.functionSignature;
|
| signature.forEachParameter((ParameterElement parameter) {
|
| - if (parameter.isFieldParameter()) {
|
| + if (parameter.isFieldParameter) {
|
| Node node = parameter.node;
|
| error(node, MessageKind.INITIALIZING_FORMAL_NOT_ALLOWED);
|
| }
|
| @@ -1629,7 +1629,7 @@ class TypeResolver {
|
| if (prefixName != null) {
|
| Element prefixElement =
|
| lookupInScope(compiler, prefixName, scope, prefixName.source);
|
| - if (prefixElement != null && prefixElement.isPrefix()) {
|
| + if (prefixElement != null && prefixElement.isPrefix) {
|
| // The receiver is a prefix. Lookup in the imported members.
|
| PrefixElement prefix = prefixElement;
|
| element = prefix.lookupLocalMember(typeName.source);
|
| @@ -1718,17 +1718,17 @@ class TypeResolver {
|
| if (element == null) {
|
| type = reportFailureAndCreateType(
|
| MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.typeName});
|
| - } else if (element.isAmbiguous()) {
|
| + } else if (element.isAmbiguous) {
|
| AmbiguousElement ambiguous = element;
|
| type = reportFailureAndCreateType(
|
| ambiguous.messageKind, ambiguous.messageArguments);
|
| ambiguous.diagnose(visitor.mapping.currentElement, compiler);
|
| - } else if (element.isErroneous()) {
|
| + } else if (element.isErroneous) {
|
| ErroneousElement erroneousElement = element;
|
| type = reportFailureAndCreateType(
|
| erroneousElement.messageKind, erroneousElement.messageArguments,
|
| erroneousElement: erroneousElement);
|
| - } else if (!element.impliesType()) {
|
| + } else if (!element.impliesType) {
|
| type = reportFailureAndCreateType(
|
| MessageKind.NOT_A_TYPE, {'node': node.typeName});
|
| } else {
|
| @@ -1736,7 +1736,7 @@ class TypeResolver {
|
| if (identical(element, compiler.types.voidType.element) ||
|
| identical(element, compiler.dynamicClass)) {
|
| type = checkNoTypeArguments(element.computeType(compiler));
|
| - } else if (element.isClass()) {
|
| + } else if (element.isClass) {
|
| ClassElement cls = element;
|
| compiler.resolver._ensureClassWillBeResolved(cls);
|
| element.computeType(compiler);
|
| @@ -1755,7 +1755,7 @@ class TypeResolver {
|
| addTypeVariableBoundsCheck = true;
|
| }
|
| }
|
| - } else if (element.isTypedef()) {
|
| + } else if (element.isTypedef) {
|
| TypedefElement typdef = element;
|
| // TODO(ahe): Should be [ensureResolved].
|
| compiler.resolveTypedef(typdef);
|
| @@ -1774,13 +1774,13 @@ class TypeResolver {
|
| addTypeVariableBoundsCheck = true;
|
| }
|
| }
|
| - } else if (element.isTypeVariable()) {
|
| + } else if (element.isTypeVariable) {
|
| Element outer =
|
| - visitor.enclosingElement.getOutermostEnclosingMemberOrTopLevel();
|
| + visitor.enclosingElement.outermostEnclosingMemberOrTopLevel;
|
| bool isInFactoryConstructor =
|
| - outer != null && outer.isFactoryConstructor();
|
| - if (!outer.isClass() &&
|
| - !outer.isTypedef() &&
|
| + outer != null && outer.isFactoryConstructor;
|
| + if (!outer.isClass &&
|
| + !outer.isTypedef &&
|
| !isInFactoryConstructor &&
|
| Elements.isInStaticContext(visitor.enclosingElement)) {
|
| compiler.backend.registerThrowRuntimeError(visitor.mapping);
|
| @@ -1961,8 +1961,8 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
|
|
| bool isPotentiallyMutableTarget(Element target) {
|
| if (target == null) return false;
|
| - return (target.isVariable() || target.isParameter()) &&
|
| - !(target.modifiers.isFinal() || target.modifiers.isConst());
|
| + return (target.isVariable || target.isParameter) &&
|
| + !(target.modifiers.isFinal || target.modifiers.isConst);
|
| }
|
|
|
| // TODO(ahe): Find a way to share this with runtime implementation.
|
| @@ -1997,18 +1997,18 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| // When the element is a field, we are actually resolving its
|
| // initial value, which should not have access to instance
|
| // fields.
|
| - inInstanceContext = (element.isInstanceMember() && !element.isField())
|
| - || element.isGenerativeConstructor(),
|
| - this.currentClass = element.isMember() ? element.getEnclosingClass()
|
| + inInstanceContext = (element.isInstanceMember && !element.isField)
|
| + || element.isGenerativeConstructor,
|
| + this.currentClass = element.isMember ? element.enclosingClass
|
| : null,
|
| this.statementScope = new StatementScope(),
|
| scope = element.buildScope(),
|
| // The type annotations on a typedef do not imply type checks.
|
| // TODO(karlklose): clean this up (dartbug.com/8870).
|
| inCheckContext = compiler.enableTypeAssertions &&
|
| - !element.isLibrary() &&
|
| - !element.isTypedef() &&
|
| - !element.enclosingElement.isTypedef(),
|
| + !element.isLibrary &&
|
| + !element.isTypedef &&
|
| + !element.enclosingElement.isTypedef,
|
| inCatchBlock = false,
|
| super(compiler, mapping);
|
|
|
| @@ -2016,13 +2016,13 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
|
|
| Element reportLookupErrorIfAny(Element result, Node node, String name) {
|
| if (!Elements.isUnresolved(result)) {
|
| - if (!inInstanceContext && result.isInstanceMember()) {
|
| + if (!inInstanceContext && result.isInstanceMember) {
|
| compiler.reportError(
|
| node, MessageKind.NO_INSTANCE_AVAILABLE, {'name': name});
|
| return new ErroneousElementX(MessageKind.NO_INSTANCE_AVAILABLE,
|
| {'name': name},
|
| name, enclosingElement);
|
| - } else if (result.isAmbiguous()) {
|
| + } else if (result.isAmbiguous) {
|
| AmbiguousElement ambiguous = result;
|
| compiler.reportError(
|
| node, ambiguous.messageKind, ambiguous.messageArguments);
|
| @@ -2108,7 +2108,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| {'name': node});
|
| compiler.backend.registerThrowNoSuchMethod(mapping);
|
| }
|
| - } else if (element.isErroneous()) {
|
| + } else if (element.isErroneous) {
|
| // Use the erroneous element.
|
| } else {
|
| if ((element.kind.category & allowedCategory) == 0) {
|
| @@ -2117,7 +2117,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| {'text': "is not an expression $element"});
|
| }
|
| }
|
| - if (!Elements.isUnresolved(element) && element.isClass()) {
|
| + if (!Elements.isUnresolved(element) && element.isClass) {
|
| ClassElement classElement = element;
|
| classElement.ensureResolved(compiler);
|
| }
|
| @@ -2143,10 +2143,10 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| String constructorName = node.selector.asIdentifier().source;
|
| return new Selector.callConstructor(
|
| constructorName,
|
| - enclosingElement.getLibrary());
|
| + enclosingElement.library);
|
| } else {
|
| return new Selector.callDefaultConstructor(
|
| - enclosingElement.getLibrary());
|
| + enclosingElement.library);
|
| }
|
| }
|
|
|
| @@ -2161,7 +2161,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| Initializers.isConstructorRedirect(initializers.head)) {
|
| Selector selector =
|
| getRedirectingThisOrSuperConstructorSelector(initializers.head);
|
| - final ClassElement classElement = constructor.getEnclosingClass();
|
| + final ClassElement classElement = constructor.enclosingClass;
|
| return classElement.lookupConstructor(selector);
|
| }
|
| return null;
|
| @@ -2169,7 +2169,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
|
|
| void setupFunction(FunctionExpression node, FunctionElement function) {
|
| Element enclosingElement = function.enclosingElement;
|
| - if (node.modifiers.isStatic() &&
|
| + if (node.modifiers.isStatic &&
|
| enclosingElement.kind != ElementKind.CLASS) {
|
| compiler.reportError(node, MessageKind.ILLEGAL_STATIC);
|
| }
|
| @@ -2325,7 +2325,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| if (node.receiver == null) {
|
| // If this send is of the form "assert(expr);", then
|
| // this is an assertion.
|
| - if (selector.isAssert()) {
|
| + if (selector.isAssert) {
|
| if (selector.argumentCount != 1) {
|
| error(node.selector,
|
| MessageKind.WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT,
|
| @@ -2387,7 +2387,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| }
|
| } else if (Elements.isUnresolved(resolvedReceiver)) {
|
| return null;
|
| - } else if (resolvedReceiver.isClass()) {
|
| + } else if (resolvedReceiver.isClass) {
|
| ClassElement receiverClass = resolvedReceiver;
|
| receiverClass.ensureResolved(compiler);
|
| if (node.isOperator) {
|
| @@ -2402,7 +2402,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| MembersCreator.computeClassMembersByName(
|
| compiler, receiverClass.declaration, name);
|
| target = receiverClass.lookupLocalMember(name);
|
| - if (target == null || target.isInstanceMember()) {
|
| + if (target == null || target.isInstanceMember) {
|
| compiler.backend.registerThrowNoSuchMethod(mapping);
|
| // TODO(johnniwinther): With the simplified [TreeElements] invariant,
|
| // try to resolve injected elements if [currentClass] is in the patch
|
| @@ -2490,7 +2490,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| arity++;
|
| }
|
|
|
| - if (element != null && element.isConstructor()) {
|
| + if (element != null && element.isConstructor) {
|
| return new Selector.callConstructor(
|
| element.name, library, arity, named);
|
| }
|
| @@ -2502,7 +2502,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| }
|
|
|
| Selector resolveSelector(Send node, Element element) {
|
| - LibraryElement library = enclosingElement.getLibrary();
|
| + LibraryElement library = enclosingElement.library;
|
| Selector selector = computeSendSelector(node, library, element);
|
| if (selector != null) mapping.setSelector(node, selector);
|
| return selector;
|
| @@ -2555,7 +2555,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| }
|
|
|
| if (!Elements.isUnresolved(target)) {
|
| - if (target.isAbstractField()) {
|
| + if (target.isAbstractField) {
|
| AbstractFieldElement field = target;
|
| target = field.getter;
|
| if (target == null && !inInstanceContext) {
|
| @@ -2564,16 +2564,16 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| warnAndCreateErroneousElement(node.selector, field.name,
|
| MessageKind.CANNOT_RESOLVE_GETTER);
|
| }
|
| - } else if (target.isTypeVariable()) {
|
| - ClassElement cls = target.getEnclosingClass();
|
| - assert(enclosingElement.getEnclosingClass() == cls);
|
| + } else if (target.isTypeVariable) {
|
| + ClassElement cls = target.enclosingClass;
|
| + assert(enclosingElement.enclosingClass == cls);
|
| compiler.backend.registerClassUsingVariableExpression(cls);
|
| compiler.backend.registerTypeVariableExpression(mapping);
|
| // Set the type of the node to [Type] to mark this send as a
|
| // type variable expression.
|
| mapping.setType(node, compiler.typeClass.computeType(compiler));
|
| world.registerTypeLiteral(target, mapping);
|
| - } else if (target.impliesType() && (!sendIsMemberAccess || node.isCall)) {
|
| + } else if (target.impliesType && (!sendIsMemberAccess || node.isCall)) {
|
| // Set the type of the node to [Type] to mark this send as a
|
| // type literal.
|
| mapping.setType(node, compiler.typeClass.computeType(compiler));
|
| @@ -2633,15 +2633,15 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
|
|
| if (node.isCall) {
|
| if (Elements.isUnresolved(target) ||
|
| - target.isGetter() ||
|
| - target.isField() ||
|
| + target.isGetter ||
|
| + target.isField ||
|
| Elements.isClosureSend(node, target)) {
|
| // If we don't know what we're calling or if we are calling a getter,
|
| // we need to register that fact that we may be calling a closure
|
| // with the same arguments.
|
| Selector call = new Selector.callClosureFrom(selector);
|
| world.registerDynamicInvocation(call);
|
| - } else if (target.impliesType()) {
|
| + } else if (target.impliesType) {
|
| // We call 'call()' on a Type instance returned from the reference to a
|
| // class or typedef literal. We do not need to register this call as a
|
| // dynamic invocation, because we statically know what the target is.
|
| @@ -2710,7 +2710,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| String source = operatorName;
|
| bool isComplex = !identical(source, '=');
|
| if (!Elements.isUnresolved(target)) {
|
| - if (target.isAbstractField()) {
|
| + if (target.isAbstractField) {
|
| AbstractFieldElement field = target;
|
| setter = field.setter;
|
| getter = field.getter;
|
| @@ -2724,16 +2724,16 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| node.selector, field.name, MessageKind.CANNOT_RESOLVE_GETTER);
|
| compiler.backend.registerThrowNoSuchMethod(mapping);
|
| }
|
| - } else if (target.impliesType()) {
|
| + } else if (target.impliesType) {
|
| setter = warnAndCreateErroneousElement(
|
| node.selector, target.name, MessageKind.ASSIGNING_TYPE);
|
| compiler.backend.registerThrowNoSuchMethod(mapping);
|
| - } else if (target.modifiers.isFinal() ||
|
| - target.modifiers.isConst() ||
|
| - (target.isFunction() &&
|
| + } else if (target.modifiers.isFinal ||
|
| + target.modifiers.isConst ||
|
| + (target.isFunction &&
|
| Elements.isStaticOrTopLevelFunction(target) &&
|
| - !target.isSetter())) {
|
| - if (target.isFunction()) {
|
| + !target.isSetter)) {
|
| + if (target.isFunction) {
|
| setter = warnAndCreateErroneousElement(
|
| node.selector, target.name, MessageKind.ASSIGNING_METHOD);
|
| } else {
|
| @@ -2758,10 +2758,10 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| Selector selector = mapping.getSelector(node);
|
| if (isComplex) {
|
| Selector getterSelector;
|
| - if (selector.isSetter()) {
|
| + if (selector.isSetter) {
|
| getterSelector = new Selector.getterFrom(selector);
|
| } else {
|
| - assert(selector.isIndexSet());
|
| + assert(selector.isIndexSet);
|
| getterSelector = new Selector.index();
|
| }
|
| registerSend(getterSelector, getter);
|
| @@ -2800,10 +2800,10 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| }
|
|
|
| void registerSend(Selector selector, Element target) {
|
| - if (target == null || target.isInstanceMember()) {
|
| - if (selector.isGetter()) {
|
| + if (target == null || target.isInstanceMember) {
|
| + if (selector.isGetter) {
|
| world.registerDynamicGetter(selector);
|
| - } else if (selector.isSetter()) {
|
| + } else if (selector.isSetter) {
|
| world.registerDynamicSetter(selector);
|
| } else {
|
| world.registerDynamicInvocation(selector);
|
| @@ -2811,7 +2811,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| } else if (Elements.isStaticOrTopLevel(target)) {
|
| // Avoid registration of type variables since they are not analyzable but
|
| // instead resolved through their enclosing type declaration.
|
| - if (!target.isTypeVariable()) {
|
| + if (!target.isTypeVariable) {
|
| // [target] might be the implementation element and only declaration
|
| // elements may be registered.
|
| world.registerStaticUse(target.declaration);
|
| @@ -2878,7 +2878,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| } else {
|
| Node expression = node.expression;
|
| if (expression != null &&
|
| - enclosingElement.isGenerativeConstructor()) {
|
| + enclosingElement.isGenerativeConstructor) {
|
| // It is a compile-time error if a return statement of the form
|
| // `return e;` appears in a generative constructor. (Dart Language
|
| // Specification 13.12.)
|
| @@ -2891,14 +2891,14 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
|
|
| void handleRedirectingFactoryBody(Return node) {
|
| final isSymbolConstructor = enclosingElement == compiler.symbolConstructor;
|
| - if (!enclosingElement.isFactoryConstructor()) {
|
| + if (!enclosingElement.isFactoryConstructor) {
|
| compiler.reportError(
|
| node, MessageKind.FACTORY_REDIRECTION_IN_NON_FACTORY);
|
| compiler.reportHint(
|
| enclosingElement, MessageKind.MISSING_FACTORY_KEYWORD);
|
| }
|
| FunctionElement constructor = enclosingElement;
|
| - bool isConstConstructor = constructor.modifiers.isConst();
|
| + bool isConstConstructor = constructor.modifiers.isConst;
|
| FunctionElement redirectionTarget = resolveRedirectingFactory(
|
| node, inConstContext: isConstConstructor);
|
| constructor.defaultImplementation = redirectionTarget;
|
| @@ -2908,7 +2908,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| return;
|
| } else {
|
| if (isConstConstructor &&
|
| - !redirectionTarget.modifiers.isConst()) {
|
| + !redirectionTarget.modifiers.isConst) {
|
| compiler.reportError(node, MessageKind.CONSTRUCTOR_IS_NOT_CONST);
|
| }
|
| if (redirectionTarget == constructor) {
|
| @@ -2919,7 +2919,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
|
|
| // Check that the target constructor is type compatible with the
|
| // redirecting constructor.
|
| - ClassElement targetClass = redirectionTarget.getEnclosingClass();
|
| + ClassElement targetClass = redirectionTarget.enclosingClass;
|
| InterfaceType type = mapping.getType(node.expression);
|
| FunctionType targetType = redirectionTarget.computeType(compiler)
|
| .subst(type.typeArguments, targetClass.typeVariables);
|
| @@ -2986,17 +2986,17 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| compiler.reportError(modifierNode, MessageKind.EXTRANEOUS_MODIFIER,
|
| {'modifier': modifier});
|
| }
|
| - if (modifiers.isFinal() && (modifiers.isConst() || modifiers.isVar())) {
|
| + if (modifiers.isFinal && (modifiers.isConst || modifiers.isVar)) {
|
| reportExtraModifier('final');
|
| }
|
| - if (modifiers.isVar() && (modifiers.isConst() || node.type != null)) {
|
| + if (modifiers.isVar && (modifiers.isConst || node.type != null)) {
|
| reportExtraModifier('var');
|
| }
|
| - if (enclosingElement.isFunction()) {
|
| - if (modifiers.isAbstract()) {
|
| + if (enclosingElement.isFunction) {
|
| + if (modifiers.isAbstract) {
|
| reportExtraModifier('abstract');
|
| }
|
| - if (modifiers.isStatic()) {
|
| + if (modifiers.isStatic) {
|
| reportExtraModifier('static');
|
| }
|
| }
|
| @@ -3024,7 +3024,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| FunctionElement constructor = resolveConstructor(node);
|
| final bool isSymbolConstructor = constructor == compiler.symbolConstructor;
|
| final bool isMirrorsUsedConstant =
|
| - node.isConst() && (constructor == compiler.mirrorsUsedConstructor);
|
| + node.isConst && (constructor == compiler.mirrorsUsedConstructor);
|
| resolveSelector(node.send, constructor);
|
| resolveArguments(node.send.argumentsNode);
|
| useElement(node.send, constructor);
|
| @@ -3038,23 +3038,23 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| // [constructor] might be the implementation element
|
| // and only declaration elements may be registered.
|
| world.registerStaticUse(constructor.declaration);
|
| - ClassElement cls = constructor.getEnclosingClass();
|
| + ClassElement cls = constructor.enclosingClass;
|
| InterfaceType type = mapping.getType(node);
|
| - if (node.isConst() && type.containsTypeVariables) {
|
| + if (node.isConst && type.containsTypeVariables) {
|
| compiler.reportError(node.send.selector,
|
| MessageKind.TYPE_VARIABLE_IN_CONSTANT);
|
| }
|
| world.registerInstantiatedType(type, mapping);
|
| - if (constructor.isFactoryConstructor() && !type.typeArguments.isEmpty) {
|
| + if (constructor.isFactoryConstructor && !type.typeArguments.isEmpty) {
|
| world.registerFactoryWithTypeArguments(mapping);
|
| }
|
| - if (constructor.isGenerativeConstructor() && cls.isAbstract) {
|
| + if (constructor.isGenerativeConstructor && cls.isAbstract) {
|
| warning(node, MessageKind.ABSTRACT_CLASS_INSTANTIATION);
|
| compiler.backend.registerAbstractClassInstantiation(mapping);
|
| }
|
|
|
| if (isSymbolConstructor) {
|
| - if (node.isConst()) {
|
| + if (node.isConst) {
|
| Node argumentNode = node.send.arguments.head;
|
| Constant name = compiler.resolver.constantCompiler.compileNode(
|
| argumentNode, mapping);
|
| @@ -3081,7 +3081,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| } else if (isMirrorsUsedConstant) {
|
| compiler.mirrorUsageAnalyzerTask.validate(node, mapping);
|
| }
|
| - if (node.isConst()) {
|
| + if (node.isConst) {
|
| analyzeConstant(node);
|
| }
|
|
|
| @@ -3097,7 +3097,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| ClassElement cls = keyType.element;
|
| if (cls == compiler.stringClass) continue;
|
| Element equals = cls.lookupMember('==');
|
| - if (equals.getEnclosingClass() != compiler.objectClass) {
|
| + if (equals.enclosingClass != compiler.objectClass) {
|
| compiler.reportError(spannable,
|
| MessageKind.CONST_MAP_KEY_OVERRIDES_EQUALS,
|
| {'type': keyType});
|
| @@ -3209,7 +3209,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| }
|
| DartType listType;
|
| if (typeArgument != null) {
|
| - if (node.isConst() && typeArgument.containsTypeVariables) {
|
| + if (node.isConst && typeArgument.containsTypeVariables) {
|
| compiler.reportError(arguments.nodes.head,
|
| MessageKind.TYPE_VARIABLE_IN_CONSTANT);
|
| }
|
| @@ -3223,7 +3223,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| world.registerInstantiatedType(listType, mapping);
|
| compiler.backend.registerRequiredType(listType, enclosingElement);
|
| visit(node.elements);
|
| - if (node.isConst()) {
|
| + if (node.isConst) {
|
| analyzeConstant(node);
|
| }
|
|
|
| @@ -3312,7 +3312,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| }
|
|
|
| visitForIn(ForIn node) {
|
| - LibraryElement library = enclosingElement.getLibrary();
|
| + LibraryElement library = enclosingElement.library;
|
| mapping.setIteratorSelector(node, compiler.iteratorSelector);
|
| world.registerDynamicGetter(compiler.iteratorSelector);
|
| mapping.setCurrentSelector(node, compiler.currentSelector);
|
| @@ -3441,18 +3441,18 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| compiler.mapClass.computeType(compiler);
|
| mapType = compiler.mapClass.rawType;
|
| }
|
| - if (node.isConst() && mapType.containsTypeVariables) {
|
| + if (node.isConst && mapType.containsTypeVariables) {
|
| compiler.reportError(arguments,
|
| MessageKind.TYPE_VARIABLE_IN_CONSTANT);
|
| }
|
| mapping.setType(node, mapType);
|
| world.registerInstantiatedType(mapType, mapping);
|
| - if (node.isConst()) {
|
| + if (node.isConst) {
|
| compiler.backend.registerConstantMap(mapping);
|
| }
|
| compiler.backend.registerRequiredType(mapType, enclosingElement);
|
| node.visitChildren(this);
|
| - if (node.isConst()) {
|
| + if (node.isConst) {
|
| analyzeConstant(node);
|
| }
|
|
|
| @@ -3482,7 +3482,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| bool overridesEquals(DartType type) {
|
| ClassElement cls = type.element;
|
| Element equals = cls.lookupMember('==');
|
| - return equals.getEnclosingClass() != compiler.objectClass;
|
| + return equals.enclosingClass != compiler.objectClass;
|
| }
|
|
|
| void checkCaseExpressions(SwitchStatement node) {
|
| @@ -3761,7 +3761,7 @@ class TypeDefinitionVisitor extends MappingVisitor<DartType> {
|
| const Link<TypeVariableElement>();
|
| seenTypeVariables = seenTypeVariables.prepend(variableElement);
|
| DartType bound = boundType;
|
| - while (bound.element.isTypeVariable()) {
|
| + while (bound.element.isTypeVariable) {
|
| TypeVariableElement element = bound.element;
|
| if (seenTypeVariables.contains(element)) {
|
| if (identical(element, variableElement)) {
|
| @@ -3983,7 +3983,7 @@ class ClassResolverVisitor extends TypeDefinitionVisitor {
|
|
|
| if (!element.hasConstructor) {
|
| Element superMember = element.superclass.localLookup('');
|
| - if (superMember == null || !superMember.isGenerativeConstructor()) {
|
| + if (superMember == null || !superMember.isGenerativeConstructor) {
|
| MessageKind kind = MessageKind.CANNOT_FIND_CONSTRUCTOR;
|
| Map arguments = {'constructorName': ''};
|
| // TODO(ahe): Why is this a compile-time error? Or if it is an error,
|
| @@ -3993,7 +3993,7 @@ class ClassResolverVisitor extends TypeDefinitionVisitor {
|
| kind, arguments, '', element);
|
| compiler.backend.registerThrowNoSuchMethod(mapping);
|
| } else {
|
| - Selector callToMatch = new Selector.call("", element.getLibrary(), 0);
|
| + Selector callToMatch = new Selector.call("", element.library, 0);
|
| if (!callToMatch.applies(superMember, compiler)) {
|
| MessageKind kind = MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT;
|
| compiler.reportError(node, kind);
|
| @@ -4055,7 +4055,7 @@ class ClassResolverVisitor extends TypeDefinitionVisitor {
|
| String mixinName = mixinType.name;
|
| MixinApplicationElementX mixinApplication = new MixinApplicationElementX(
|
| "${superName}+${mixinName}",
|
| - element.getCompilationUnit(),
|
| + element.compilationUnit,
|
| compiler.getNextFreeClassId(),
|
| node,
|
| new Modifiers.withFlags(new NodeList.empty(), Modifiers.FLAG_ABSTRACT));
|
| @@ -4154,7 +4154,7 @@ class ClassResolverVisitor extends TypeDefinitionVisitor {
|
| // Create forwarding constructors for constructor defined in the superclass
|
| // because they are now hidden by the mixin application.
|
| superclass.forEachLocalMember((Element member) {
|
| - if (!member.isGenerativeConstructor()) return;
|
| + if (!member.isGenerativeConstructor) return;
|
| FunctionElement forwarder =
|
| createForwardingConstructor(member, mixinApplication);
|
| mixinApplication.addConstructor(forwarder);
|
| @@ -4316,7 +4316,7 @@ class ClassResolverVisitor extends TypeDefinitionVisitor {
|
| }
|
|
|
| isBlackListed(DartType type) {
|
| - LibraryElement lib = element.getLibrary();
|
| + LibraryElement lib = element.library;
|
| return
|
| !identical(lib, compiler.coreLibrary) &&
|
| !identical(lib, compiler.jsHelperLibrary) &&
|
| @@ -4381,7 +4381,7 @@ class ClassSupertypeResolver extends CommonResolverVisitor {
|
|
|
| void visitIdentifier(Identifier node) {
|
| Element element = lookupInScope(compiler, node, context, node.source);
|
| - if (element != null && element.isClass()) {
|
| + if (element != null && element.isClass) {
|
| loadSupertype(element, node);
|
| }
|
| }
|
| @@ -4400,7 +4400,7 @@ class ClassSupertypeResolver extends CommonResolverVisitor {
|
| PrefixElement prefixElement = element;
|
| Identifier selector = node.selector.asIdentifier();
|
| var e = prefixElement.lookupLocalMember(selector.source);
|
| - if (e == null || !e.impliesType()) {
|
| + if (e == null || !e.impliesType) {
|
| error(node.selector, MessageKind.CANNOT_RESOLVE_TYPE,
|
| {'typeName': node.selector});
|
| return;
|
| @@ -4442,10 +4442,10 @@ class VariableDefinitionsVisitor extends CommonResolverVisitor<Identifier> {
|
| // The variable is initialized to null.
|
| resolver.world.registerInstantiatedClass(compiler.nullClass,
|
| resolver.mapping);
|
| - if (definitions.modifiers.isConst()) {
|
| + if (definitions.modifiers.isConst) {
|
| compiler.reportError(node, MessageKind.CONST_WITHOUT_INITIALIZER);
|
| }
|
| - if (definitions.modifiers.isFinal() &&
|
| + if (definitions.modifiers.isFinal &&
|
| !resolver.allowFinalWithoutInitializer) {
|
| compiler.reportError(node, MessageKind.FINAL_WITHOUT_INITIALIZER);
|
| }
|
| @@ -4459,7 +4459,7 @@ class VariableDefinitionsVisitor extends CommonResolverVisitor<Identifier> {
|
| name.source, kind, resolver.enclosingElement,
|
| variables, name.token);
|
| resolver.defineElement(link.head, element);
|
| - if (definitions.modifiers.isConst()) {
|
| + if (definitions.modifiers.isConst) {
|
| compiler.enqueuer.resolution.addDeferredAction(element, () {
|
| compiler.resolver.constantCompiler.compileConstant(element);
|
| });
|
| @@ -4500,10 +4500,10 @@ class ConstructorResolver extends CommonResolverVisitor<Element> {
|
| Selector createConstructorSelector(String constructorName) {
|
| return constructorName == ''
|
| ? new Selector.callDefaultConstructor(
|
| - resolver.enclosingElement.getLibrary())
|
| + resolver.enclosingElement.library)
|
| : new Selector.callConstructor(
|
| constructorName,
|
| - resolver.enclosingElement.getLibrary());
|
| + resolver.enclosingElement.library);
|
| }
|
|
|
| FunctionElement resolveConstructor(ClassElement cls,
|
| @@ -4523,14 +4523,14 @@ class ConstructorResolver extends CommonResolverVisitor<Element> {
|
| fullConstructorName,
|
| MessageKind.CANNOT_FIND_CONSTRUCTOR,
|
| {'constructorName': fullConstructorName});
|
| - } else if (inConstContext && !result.modifiers.isConst()) {
|
| + } else if (inConstContext && !result.modifiers.isConst) {
|
| error(diagnosticNode, MessageKind.CONSTRUCTOR_IS_NOT_CONST);
|
| }
|
| return result;
|
| }
|
|
|
| Element visitNewExpression(NewExpression node) {
|
| - inConstContext = node.isConst();
|
| + inConstContext = node.isConst;
|
| Node selector = node.send.selector;
|
| Element element = visit(selector);
|
| assert(invariant(selector, element != null,
|
| @@ -4547,8 +4547,8 @@ class ConstructorResolver extends CommonResolverVisitor<Element> {
|
| message: 'No element return for $diagnosticNode.'));
|
| // Find the unnamed constructor if the reference resolved to a
|
| // class.
|
| - if (!Elements.isUnresolved(element) && !element.isConstructor()) {
|
| - if (element.isClass()) {
|
| + if (!Elements.isUnresolved(element) && !element.isConstructor) {
|
| + if (element.isClass) {
|
| ClassElement cls = element;
|
| cls.ensureResolved(compiler);
|
| // The unnamed constructor may not exist, so [e] may become unresolved.
|
| @@ -4563,7 +4563,7 @@ class ConstructorResolver extends CommonResolverVisitor<Element> {
|
| if (Elements.isUnresolved(element)) {
|
| type = compiler.types.dynamicType;
|
| } else {
|
| - type = element.getEnclosingClass().rawType;
|
| + type = element.enclosingClass.rawType;
|
| }
|
| }
|
| resolver.mapping.setType(expression, type);
|
| @@ -4589,11 +4589,11 @@ class ConstructorResolver extends CommonResolverVisitor<Element> {
|
| Identifier name = node.selector.asIdentifier();
|
| if (name == null) internalError(node.selector, 'unexpected node');
|
|
|
| - if (element.isClass()) {
|
| + if (element.isClass) {
|
| ClassElement cls = element;
|
| cls.ensureResolved(compiler);
|
| return resolveConstructor(cls, name, name.source);
|
| - } else if (element.isPrefix()) {
|
| + } else if (element.isPrefix) {
|
| PrefixElement prefix = element;
|
| element = prefix.lookupLocalMember(name.source);
|
| element = Elements.unwrap(element, compiler, node);
|
| @@ -4603,7 +4603,7 @@ class ConstructorResolver extends CommonResolverVisitor<Element> {
|
| name.source,
|
| MessageKind.CANNOT_RESOLVE,
|
| {'name': name});
|
| - } else if (!element.isClass()) {
|
| + } else if (!element.isClass) {
|
| error(node, MessageKind.NOT_A_TYPE, {'node': name});
|
| }
|
| } else {
|
| @@ -4622,15 +4622,15 @@ class ConstructorResolver extends CommonResolverVisitor<Element> {
|
| return failOrReturnErroneousElement(resolver.enclosingElement, node, name,
|
| MessageKind.CANNOT_RESOLVE,
|
| {'name': name});
|
| - } else if (element.isErroneous()) {
|
| + } else if (element.isErroneous) {
|
| return element;
|
| - } else if (element.isTypedef()) {
|
| + } else if (element.isTypedef) {
|
| error(node, MessageKind.CANNOT_INSTANTIATE_TYPEDEF,
|
| {'typedefName': name});
|
| - } else if (element.isTypeVariable()) {
|
| + } else if (element.isTypeVariable) {
|
| error(node, MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE,
|
| {'typeVariableName': name});
|
| - } else if (!element.isClass() && !element.isPrefix()) {
|
| + } else if (!element.isClass && !element.isPrefix) {
|
| error(node, MessageKind.NOT_A_TYPE, {'node': name});
|
| }
|
| return element;
|
|
|