protected void generateInitializers(@NotNull Function0<ExpressionCodegen> createCodegen) { NotNullLazyValue<ExpressionCodegen> codegen = LockBasedStorageManager.NO_LOCKS.createLazyValue(createCodegen); for (JetDeclaration declaration : ((JetDeclarationContainer) element).getDeclarations()) { if (declaration instanceof JetProperty) { if (shouldInitializeProperty((JetProperty) declaration)) { initializeProperty(codegen.invoke(), (JetProperty) declaration); } } else if (declaration instanceof JetClassInitializer) { codegen.invoke().gen(((JetClassInitializer) declaration).getBody(), Type.VOID_TYPE); } } }
@Override public String toString() { try { if (lazyValue.isComputed()) { return getActualType().toString(); } else { return "<Not computed yet>"; } } catch (ReenteringLazyValueComputationException e) { return "<Failed to compute this type>"; } }
@NotNull @Override public JetType getDefaultType() { return defaultType.invoke(); }
@NotNull @Override public TypeConstructor getTypeConstructor() { return typeConstructor.invoke(); }
@NotNull @Override public JetType getUpperBoundsAsType() { return upperBoundsAsType.invoke(); }
@NotNull public JetType getActualType() { return lazyValue.invoke(); }
public boolean isComputed() { return lazyValue.isComputed(); }
@NotNull @Override public ReceiverParameterDescriptor getThisAsReceiverParameter() { return thisAsReceiverParameter.invoke(); }
@NotNull public JetScope getScopeForPropertyInitializerResolution() { return scopeForPropertyInitializerResolution.invoke(); }
@NotNull public JetScope getScopeForMemberDeclarationResolution() { return scopeForMemberDeclarationResolution.invoke(); }
@NotNull public JetScope getScopeForClassHeaderResolution() { return scopeForClassHeaderResolution.invoke(); }