Search in sources :

Example 1 with ImplicitReferenceType

use of dyvilx.tools.compiler.ast.reference.ImplicitReferenceType in project Dyvil by Dyvil.

the class PostfixType method resolveType.

@Override
public IType resolveType(MarkerList markers, IContext context) {
    final String unqualified = this.name.unqualified;
    final IType argument = this.arguments.get(0);
    if (unqualified.length() == 1) {
        switch(unqualified.charAt(0)) {
            case '?':
                return NullableType.apply(argument).resolveType(markers, context);
            case '!':
                return new ImplicitNullableType(argument).resolveType(markers, context);
            case '*':
                return new ReferenceType(argument).resolveType(markers, context);
            case '^':
                return new ImplicitReferenceType(argument).resolveType(markers, context);
        }
    }
    return super.resolveType(markers, context);
}
Also used : ImplicitNullableType(dyvilx.tools.compiler.ast.type.compound.ImplicitNullableType) ImplicitReferenceType(dyvilx.tools.compiler.ast.reference.ImplicitReferenceType) ImplicitReferenceType(dyvilx.tools.compiler.ast.reference.ImplicitReferenceType) ReferenceType(dyvilx.tools.compiler.ast.reference.ReferenceType) IType(dyvilx.tools.compiler.ast.type.IType)

Aggregations

ImplicitReferenceType (dyvilx.tools.compiler.ast.reference.ImplicitReferenceType)1 ReferenceType (dyvilx.tools.compiler.ast.reference.ReferenceType)1 IType (dyvilx.tools.compiler.ast.type.IType)1 ImplicitNullableType (dyvilx.tools.compiler.ast.type.compound.ImplicitNullableType)1