use of org.eclipse.ceylon.compiler.java.runtime.metamodel.meta.ValueImpl in project ceylon by eclipse.
the class ValueDeclarationImpl method applyInternal.
protected <Get, Set> ceylon.language.meta.model.Value<Get, Set> applyInternal(TypeDescriptor $reifiedGet, TypeDescriptor $reifiedSet, ceylon.language.meta.model.Type<?> container) {
org.eclipse.ceylon.model.typechecker.model.Value modelDecl = (org.eclipse.ceylon.model.typechecker.model.Value) declaration;
Type qType;
if (getStatic()) {
qType = ((ClassImpl) container).producedType;
} else {
qType = null;
}
org.eclipse.ceylon.model.typechecker.model.TypedReference typedReference = modelDecl.appliedTypedReference(qType, Collections.<Type>emptyList());
org.eclipse.ceylon.model.typechecker.model.Type getType = typedReference.getType();
TypeDescriptor reifiedGet = Metamodel.getTypeDescriptorForProducedType(getType);
// immutable values have Set=Nothing
org.eclipse.ceylon.model.typechecker.model.Type setType = getVariable() ? getType : modelDecl.getUnit().getNothingType();
TypeDescriptor reifiedSet = getVariable() ? reifiedGet : TypeDescriptor.NothingType;
Metamodel.checkReifiedTypeArgument("apply", "Value<$1,$2>", Variance.OUT, getType, $reifiedGet, Variance.IN, setType, $reifiedSet);
return new ValueImpl<Get, Set>(reifiedGet, reifiedSet, this, typedReference, container, null);
}
Aggregations