JetTypeCodeFragment: Remove usage of KotlinBuiltIns.getInstance()

This commit is contained in:
Pavel V. Talanov
2015-09-21 16:49:42 +03:00
parent b5712033a8
commit e35e6f7f52
2 changed files with 11 additions and 19 deletions
@@ -20,22 +20,14 @@ import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.JetNodeTypes;
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
import org.jetbrains.kotlin.types.JetType;
public class JetTypeCodeFragment extends JetCodeFragment {
public JetTypeCodeFragment(Project project, String name, CharSequence text, PsiElement context) {
super(project, name, text, null, JetNodeTypes.TYPE_CODE_FRAGMENT, context);
}
@Nullable
public JetType getType() {
JetElement typeReference = getContentElement();
if (typeReference instanceof JetTypeReference) {
//TODO return the actual type
return KotlinBuiltIns.getInstance().getAnyType();
}
return null;
public boolean hasTypeReference() {
return getContentElement() instanceof JetTypeReference;
}
@Nullable