Self-types marked as unsupported

This commit is contained in:
Andrey Breslav
2014-12-19 20:31:30 +03:00
parent f8dc0d028d
commit 633a4aa8f2
5 changed files with 32 additions and 2 deletions
@@ -19,6 +19,8 @@ package org.jetbrains.jet.lang.psi.stubs.elements;
import com.intellij.psi.tree.TokenSet;
import org.jetbrains.jet.lang.psi.*;
import static org.jetbrains.jet.JetNodeTypes.SELF_TYPE;
public interface JetStubElementTypes {
JetFileElementType FILE = new JetFileElementType();
@@ -117,7 +119,7 @@ public interface JetStubElementTypes {
TokenSet DELEGATION_SPECIFIER_TYPES = TokenSet.create(DELEGATOR_BY, DELEGATOR_SUPER_CALL, DELEGATOR_SUPER_CLASS, THIS_CALL);
TokenSet TYPE_ELEMENT_TYPES = TokenSet.create(USER_TYPE, NULLABLE_TYPE, FUNCTION_TYPE, DYNAMIC_TYPE);
TokenSet TYPE_ELEMENT_TYPES = TokenSet.create(USER_TYPE, NULLABLE_TYPE, FUNCTION_TYPE, DYNAMIC_TYPE, SELF_TYPE);
TokenSet INSIDE_DIRECTIVE_EXPRESSIONS = TokenSet.create(REFERENCE_EXPRESSION, DOT_QUALIFIED_EXPRESSION);
}
@@ -35,7 +35,6 @@ import org.jetbrains.jet.context.LazinessToken
import org.jetbrains.jet.lang.resolve.lazy.LazyEntity
import org.jetbrains.jet.lang.resolve.lazy.ForceResolveUtil
import org.jetbrains.jet.utils.addToStdlib.firstIsInstanceOrNull
import org.jetbrains.jet.lang.diagnostics.Errors
public class TypeResolver(
private val annotationResolver: AnnotationResolver,
@@ -230,6 +229,10 @@ public class TypeResolver(
}
}
override fun visitSelfType(type: JetSelfType) {
c.trace.report(UNSUPPORTED.on(type, "Self-types are not supported"))
}
override fun visitJetElement(element: JetElement) {
c.trace.report(UNSUPPORTED.on(element, "Self-types are not supported yet"))
}
@@ -0,0 +1,8 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo(f: <!UNSUPPORTED!>This<!>) {}
trait C<T: C<<!UNSUPPORTED!>This<!>>> {
val x: <!UNSUPPORTED!>This<!>
val y: <!UNSUPPORTED!>This<!>?
}
@@ -0,0 +1,11 @@
package
internal fun foo(/*0*/ f: [ERROR : This]): kotlin.Unit
internal trait C</*0*/ T : C<[ERROR : This]>> {
internal abstract val x: [ERROR : This]
internal abstract val y: [ERROR : This]?
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -442,6 +442,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("SelfTypesUnsupported.kt")
public void testSelfTypesUnsupported() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/SelfTypesUnsupported.kt");
doTest(fileName);
}
@TestMetadata("ShiftFunctionTypes.kt")
public void testShiftFunctionTypes() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/ShiftFunctionTypes.kt");