diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtTypedef.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtTypedef.java deleted file mode 100644 index 5912fc763c2..00000000000 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtTypedef.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.psi; - -import com.intellij.lang.ASTNode; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.kotlin.KtNodeTypes; -import org.jetbrains.kotlin.name.FqName; - -public class KtTypedef extends KtTypeParameterListOwnerNotStubbed { - public KtTypedef(@NotNull ASTNode node) { - super(node); - } - - @Override - public R accept(@NotNull KtVisitor visitor, D data) { - return visitor.visitTypedef(this, data); - } - - @Nullable @IfNotParsed - public KtTypeReference getTypeReference() { - return (KtTypeReference) findChildByType(KtNodeTypes.TYPE_REFERENCE); - } - - @Nullable - @Override - public FqName getFqName() { - //TODO: typedefs are unsupported - return null; - } -} diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitor.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitor.java index 9b1a5058090..8b0647dae80 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitor.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitor.java @@ -65,10 +65,6 @@ public class KtVisitor extends PsiElementVisitor { return visitNamedDeclaration(multiDeclarationEntry, data); } - public R visitTypedef(@NotNull KtTypedef typedef, D data) { - return visitNamedDeclaration(typedef, data); - } - public R visitKtFile(@NotNull KtFile file, D data) { visitFile(file); return null; diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoid.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoid.java index 5dc8ee3f9d1..cfea6bc6b33 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoid.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoid.java @@ -61,10 +61,6 @@ public class KtVisitorVoid extends KtVisitor { super.visitDestructuringDeclarationEntry(multiDeclarationEntry, null); } - public void visitTypedef(@NotNull KtTypedef typedef) { - super.visitTypedef(typedef, null); - } - public void visitKtFile(@NotNull KtFile file) { super.visitKtFile(file, null); } @@ -494,12 +490,6 @@ public class KtVisitorVoid extends KtVisitor { return null; } - @Override - public final Void visitTypedef(@NotNull KtTypedef typedef, Void data) { - visitTypedef(typedef); - return null; - } - @Override public final Void visitKtFile(@NotNull KtFile file, Void data) { visitKtFile(file); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoidWithParameter.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoidWithParameter.java index 71401e123eb..d281dc393d9 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoidWithParameter.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoidWithParameter.java @@ -58,10 +58,6 @@ public class KtVisitorVoidWithParameter

extends KtVisitor { super.visitDestructuringDeclarationEntry(multiDeclarationEntry, data); } - public void visitTypedefVoid(@NotNull KtTypedef typedef, P data) { - super.visitTypedef(typedef, data); - } - public void visitJetFileVoid(@NotNull KtFile file, P data) { super.visitKtFile(file, data); } @@ -467,12 +463,6 @@ public class KtVisitorVoidWithParameter

extends KtVisitor { return null; } - @Override - public final Void visitTypedef(@NotNull KtTypedef typedef, P data) { - visitTypedefVoid(typedef, data); - return null; - } - @Override public final Void visitKtFile(@NotNull KtFile file, P data) { visitJetFileVoid(file, data); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/LazyTopDownAnalyzer.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/LazyTopDownAnalyzer.kt index 2af4d5aa897..a3e5e8db3a3 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/LazyTopDownAnalyzer.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/LazyTopDownAnalyzer.kt @@ -158,10 +158,6 @@ class LazyTopDownAnalyzer( c.anonymousInitializers.put(initializer, containerDescriptor) } - override fun visitTypedef(typedef: KtTypedef) { - trace.report(UNSUPPORTED.on(typedef, "Typedefs are not supported")) - } - override fun visitDestructuringDeclaration(destructuringDeclaration: KtDestructuringDeclaration) { // Ignore: multi-declarations are only allowed locally } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/declarations/AbstractPsiBasedDeclarationProvider.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/declarations/AbstractPsiBasedDeclarationProvider.kt index 8c547d048db..2e4d1f91781 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/declarations/AbstractPsiBasedDeclarationProvider.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/declarations/AbstractPsiBasedDeclarationProvider.kt @@ -54,7 +54,7 @@ abstract class AbstractPsiBasedDeclarationProvider(storageManager: StorageManage val scriptInfo = KtScriptInfo(declaration) classesAndObjects.put(scriptInfo.script.nameAsName, scriptInfo) } - else if (declaration is KtParameter || declaration is KtTypedef || declaration is KtDestructuringDeclaration) { + else if (declaration is KtParameter || declaration is KtDestructuringDeclaration) { // Do nothing, just put it into allDeclarations is enough } else { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/AbstractLazyMemberScope.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/AbstractLazyMemberScope.kt index 062229f4456..30e6593fe41 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/AbstractLazyMemberScope.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/AbstractLazyMemberScope.kt @@ -159,9 +159,8 @@ protected constructor( result.addAll(classDescriptors(name)) } } - else if (declaration is KtTypedef || declaration is KtDestructuringDeclaration) { - // Do nothing for typedefs as they are not supported. - // MultiDeclarations are not supported on global level too. + else if (declaration is KtDestructuringDeclaration) { + // MultiDeclarations are not supported on global level } else { throw IllegalArgumentException("Unsupported declaration kind: " + declaration) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingVisitorForStatements.java b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingVisitorForStatements.java index 485957059c8..51c9c4baa4c 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingVisitorForStatements.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingVisitorForStatements.java @@ -146,12 +146,6 @@ public class ExpressionTypingVisitorForStatements extends ExpressionTypingVisito return TypeInfoFactoryKt.createTypeInfo(components.dataFlowAnalyzer.checkStatementType(klass, context), context); } - @Override - public KotlinTypeInfo visitTypedef(@NotNull KtTypedef typedef, ExpressionTypingContext context) { - context.trace.report(UNSUPPORTED.on(typedef, "Typedefs are not supported")); - return super.visitTypedef(typedef, context); - } - @Override public KotlinTypeInfo visitDeclaration(@NotNull KtDeclaration dcl, ExpressionTypingContext context) { return TypeInfoFactoryKt.createTypeInfo(components.dataFlowAnalyzer.checkStatementType(dcl, context), context); diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/KotlinBundle.properties b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/KotlinBundle.properties index 361107ec14d..74e6f8935ea 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/KotlinBundle.properties +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/KotlinBundle.properties @@ -174,7 +174,6 @@ usageType.nonLocal.property.type = Class/object property type usageType.local.variable.type = Local variable type usageType.function.return.type = Function return types usageType.superType = Supertype -usageType.type.definition = Type definition usageType.is = Target type of 'is' operation usageType.as = Target type of 'as' operation usageType.class.object = Nested class/object diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/findUsages/UsageTypeUtils.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/findUsages/UsageTypeUtils.kt index b5fe352f8f0..648ba65c11f 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/findUsages/UsageTypeUtils.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/findUsages/UsageTypeUtils.kt @@ -87,9 +87,6 @@ object UsageTypeUtils { || refExpr.getParentOfTypeAndBranch(){ typeReference } != null -> SUPER_TYPE - refExpr.getParentOfTypeAndBranch(){ typeReference } != null -> - TYPE_DEFINITION - refExpr.getParentOfTypeAndBranch(){ typeReference } != null -> VALUE_PARAMETER_TYPE @@ -215,7 +212,6 @@ enum class UsageTypeEnum { NON_LOCAL_PROPERTY_TYPE, FUNCTION_RETURN_TYPE, SUPER_TYPE, - TYPE_DEFINITION, IS, CLASS_OBJECT_ACCESS, COMPANION_OBJECT_ACCESS, diff --git a/idea/src/org/jetbrains/kotlin/idea/findUsages/KotlinUsageTypeProvider.kt b/idea/src/org/jetbrains/kotlin/idea/findUsages/KotlinUsageTypeProvider.kt index d0944aa51bc..06b3f081ae7 100644 --- a/idea/src/org/jetbrains/kotlin/idea/findUsages/KotlinUsageTypeProvider.kt +++ b/idea/src/org/jetbrains/kotlin/idea/findUsages/KotlinUsageTypeProvider.kt @@ -41,7 +41,6 @@ object KotlinUsageTypeProvider : UsageTypeProviderEx { NON_LOCAL_PROPERTY_TYPE -> KotlinUsageTypes.NON_LOCAL_PROPERTY_TYPE FUNCTION_RETURN_TYPE -> KotlinUsageTypes.FUNCTION_RETURN_TYPE SUPER_TYPE -> KotlinUsageTypes.SUPER_TYPE - TYPE_DEFINITION -> KotlinUsageTypes.TYPE_DEFINITION IS -> KotlinUsageTypes.IS CLASS_OBJECT_ACCESS -> KotlinUsageTypes.CLASS_OBJECT_ACCESS COMPANION_OBJECT_ACCESS -> KotlinUsageTypes.COMPANION_OBJECT_ACCESS @@ -85,7 +84,6 @@ object KotlinUsageTypes { val NON_LOCAL_PROPERTY_TYPE = UsageType(KotlinBundle.message("usageType.nonLocal.property.type")) val FUNCTION_RETURN_TYPE = UsageType(KotlinBundle.message("usageType.function.return.type")) val SUPER_TYPE = UsageType(KotlinBundle.message("usageType.superType")) - val TYPE_DEFINITION = UsageType(KotlinBundle.message("usageType.type.definition")) val IS = UsageType(KotlinBundle.message("usageType.is")) val CLASS_OBJECT_ACCESS = UsageType(KotlinBundle.message("usageType.class.object")) val COMPANION_OBJECT_ACCESS = UsageType(KotlinBundle.message("usageType.companion.object"))