use of dyvilx.tools.compiler.ast.expression.DummyValue in project Dyvil by Dyvil.
the class UnapplyPattern method withType.
@Override
public Pattern withType(IType type, MarkerList markers) {
// PatternType.unapply(_ : MatchedType)
final IClass matchClass = this.type.getTheClass();
if (matchClass == null) {
return null;
}
final MethodCall methodCall = new MethodCall(this.position, new ClassAccess(this.type), Names.unapply, new ArgumentList(new DummyValue(type)));
final IValue resolvedCall = methodCall.resolveCall(MarkerList.BLACKHOLE, matchClass, false);
return resolvedCall != null && this.withMethod(type, resolvedCall, markers) ? this : null;
}
Aggregations