public ExpectedTypeInfoImpl(@NotNull PsiType type, @Type int kind, @NotNull PsiType defaultType, @NotNull TailType myTailType, PsiMethod calledMethod, @NotNull NullableComputable<String> expectedName) { this.type = type; this.kind = kind; this.myTailType = myTailType; this.defaultType = defaultType; myCalledMethod = calledMethod; this.expectedNameComputable = expectedName; expectedNameLazyValue = new VolatileNullableLazyValue<String>() { @Nullable @Override protected String compute() { return expectedNameComputable.compute(); } }; PsiUtil.ensureValidType(type); PsiUtil.ensureValidType(defaultType); }
public ClsTypeElementImpl(@NotNull PsiElement parent, @NotNull String typeText, char variance) { myParent = parent; myTypeText = TypeInfo.internFrequentType(typeText); myVariance = variance; myChild = new VolatileNullableLazyValue<ClsElementImpl>() { @Nullable @Override protected ClsElementImpl compute() { return calculateChild(); } }; myCachedType = new AtomicNotNullLazyValue<PsiType>() { @NotNull @Override protected PsiType compute() { return calculateType(); } }; }