@Override public void setType(JvmIdentifiableElement identifiable, LightweightTypeReference reference) { getParent().setType(identifiable, reference); }
@Override public void setType(JvmIdentifiableElement identifiable, LightweightTypeReference reference) { getParent().setType(identifiable, reference); }
protected void mergeTypesIntoParent(ResolvedTypes parent) { Map<JvmIdentifiableElement, LightweightTypeReference> types = basicGetTypes(); if (!types.isEmpty()) { for(Map.Entry<JvmIdentifiableElement, LightweightTypeReference> entry: types.entrySet()) { LightweightTypeReference value = entry.getValue(); if (value instanceof UnboundTypeReference && super.isResolved(((UnboundTypeReference) value).getHandle())) { parent.setType(entry.getKey(), value.getUpperBoundSubstitute().copyInto(parent.getReferenceOwner())); } else { parent.setType(entry.getKey(), value.copyInto(parent.getReferenceOwner())); } } } }
protected void assignType(JvmIdentifiableElement element, /* @Nullable */ LightweightTypeReference actualType, boolean addToChildScope) { if (actualType != null) { state.getResolvedTypes().setType(element, actualType); } else { state.getResolvedTypes().setType(element, state.getReferenceOwner().newAnyTypeReference()); } if (addToChildScope) state.addLocalToCurrentScope(element); }
@Override /* @Nullable */ protected JvmTypeReference doGetTypeReference(XComputedTypeReferenceImplCustom context) { try { CreateExtensionInfo createExtensionInfo = createFunction.getCreateExtensionInfo(); XExpression expression = createExtensionInfo.getCreateExpression(); LightweightTypeReference actualType = resolvedTypes.getReturnType(expression); if (actualType == null) { JvmOperation operation = typeResolver.associations.getDirectlyInferredOperation(createFunction); if (operation != null) { IFeatureScopeSession session = operation.isStatic() ? featureScopeSession : featureScopeSession.toInstanceContext(); typeResolver.computeTypes(resolvedTypesByContext, resolvedTypes, session, operation); actualType = resolvedTypes.getReturnType(expression); } } if (actualType == null) return null; // actualType may not be java compliant but still carry more information than the // java compliant reference JvmTypeReference result = typeResolver.toJavaCompliantTypeReference(actualType, featureScopeSession); if (actualType.isMultiType() || result.getType() != actualType.getType()) { resolvedTypes.setType(param, resolvedTypes.getReferenceOwner().toLightweightTypeReference(result)); resolvedTypes.reassignType(param, actualType); } return result; } finally { context.unsetTypeProviderWithoutNotification(); } } }