From 7de171efdac1c7b54da7248ebddcc71f8e3be32e Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Thu, 10 Mar 2016 14:17:28 +0300 Subject: [PATCH] Improve message clarity for WRONG_NUMBER_OF_TYPE_ARGUMENTS diagnostics #KT-9887 Fixed --- .../org/jetbrains/kotlin/diagnostics/Errors.java | 5 +++-- .../rendering/DefaultErrorMessages.java | 7 ++++--- .../kotlin/diagnostics/rendering/Renderers.kt | 3 +++ .../org/jetbrains/kotlin/resolve/TypeResolver.kt | 13 ++++++++----- .../kotlin/resolve/calls/CandidateResolver.kt | 2 +- .../calls/tasks/AbstractTracingStrategy.java | 15 +++++++-------- .../resolve/calls/tasks/TracingStrategy.java | 10 +++++++--- ...trategyForImplicitConstructorDelegationCall.kt | 4 ++-- .../expressions/ControlStructureTypingUtils.java | 2 +- .../diagnostics/tests/PackageQualified.kt | 2 +- .../diagnostics/tests/generics/argumentsForT.kt | 4 ++-- .../innerClasses/qualifiedTypesResolution.kt | 2 +- idea/testData/checker/TypeArgumentsNotAllowed.kt | 7 +++++++ idea/testData/checker/regression/kt9887.kt | 5 +++++ .../addStarProjections/unqualifiedMapOneArg.kt | 2 +- .../unqualifiedMapOneArg.kt.after | 2 +- .../when/unqualifiedMapOneArg.kt | 2 +- .../when/unqualifiedMapOneArg.kt.after | 2 +- .../callWithTypeArguments.kt | 2 +- idea/testData/quickfix/modifiers/kt10409.kt | 2 +- idea/testData/quickfix/modifiers/kt10409.kt.after | 2 +- .../kotlin/checkers/PsiCheckerTestGenerated.java | 12 ++++++++++++ .../typeParameterListChanged/build.log | 8 ++++---- 23 files changed, 75 insertions(+), 40 deletions(-) create mode 100644 idea/testData/checker/TypeArgumentsNotAllowed.kt create mode 100644 idea/testData/checker/regression/kt9887.kt diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java index 2a9358c2533..895ae986834 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. + * Copyright 2010-2016 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. @@ -98,7 +98,8 @@ public interface Errors { DiagnosticFactory0 PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT = DiagnosticFactory0.create(ERROR, VARIANCE_IN_PROJECTION); DiagnosticFactory2 UPPER_BOUND_VIOLATED = DiagnosticFactory2.create(ERROR); DiagnosticFactory0 REDUNDANT_NULLABLE = DiagnosticFactory0.create(WARNING, NULLABLE_TYPE); - DiagnosticFactory1 WRONG_NUMBER_OF_TYPE_ARGUMENTS = DiagnosticFactory1.create(ERROR); + DiagnosticFactory2 WRONG_NUMBER_OF_TYPE_ARGUMENTS = DiagnosticFactory2.create(ERROR); + DiagnosticFactory1 TYPE_ARGUMENTS_NOT_ALLOWED = DiagnosticFactory1.create(ERROR); DiagnosticFactory2 NO_TYPE_ARGUMENTS_ON_RHS = DiagnosticFactory2.create(ERROR); DiagnosticFactory1 CONFLICTING_PROJECTION = DiagnosticFactory1.create(ERROR, VARIANCE_IN_PROJECTION); DiagnosticFactory1 REDUNDANT_PROJECTION = DiagnosticFactory1.create(WARNING, VARIANCE_IN_PROJECTION); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java index d65cea20f61..572947019e1 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -656,9 +656,10 @@ public class DefaultErrorMessages { MAP.put(TYPE_INFERENCE_FAILED_ON_SPECIAL_CONSTRUCT, "Type inference for control flow expression failed. Please specify its type explicitly."); - MAP.put(WRONG_NUMBER_OF_TYPE_ARGUMENTS, "{0,choice,0#No type arguments|1#Type argument|1<{0,number,integer} type arguments} expected", (DiagnosticParameterRenderer) null); - MAP.put(NO_TYPE_ARGUMENTS_ON_RHS, "{0,choice,0#No type arguments|1#Type argument|1<{0,number,integer} type arguments} expected. " + - "Use ''{1}'' if you don''t want to pass type arguments", null, STRING); + String wrongNumberOfTypeArguments = "{0,choice,0#No type arguments|1#One type argument|1<{0,number,integer} type arguments} expected"; + MAP.put(WRONG_NUMBER_OF_TYPE_ARGUMENTS, wrongNumberOfTypeArguments + " for {1}", null, WITHOUT_MODIFIERS); + MAP.put(NO_TYPE_ARGUMENTS_ON_RHS, wrongNumberOfTypeArguments + ". Use ''{1}'' if you don''t want to pass type arguments", null, STRING); + MAP.put(TYPE_ARGUMENTS_NOT_ALLOWED, "Type arguments are not allowed {0}", STRING); MAP.put(TYPE_PARAMETER_AS_REIFIED, "Cannot use ''{0}'' as reified type parameter. Use a class instead.", NAME); MAP.put(REIFIED_TYPE_PARAMETER_NO_INLINE, "Only type parameters of inline functions can be reified"); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/Renderers.kt b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/Renderers.kt index 0f473086ecc..23f956b6710 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/Renderers.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/Renderers.kt @@ -433,6 +433,9 @@ object Renderers { @JvmField val FQ_NAMES_IN_TYPES = DescriptorRenderer.FQ_NAMES_IN_TYPES.asRenderer() @JvmField val COMPACT = DescriptorRenderer.COMPACT.asRenderer() + @JvmField val WITHOUT_MODIFIERS = DescriptorRenderer.withOptions { + modifiers = emptySet() + }.asRenderer() @JvmField val SHORT_NAMES_IN_TYPES = DescriptorRenderer.SHORT_NAMES_IN_TYPES.asRenderer() @JvmField val COMPACT_WITH_MODIFIERS = DescriptorRenderer.COMPACT_WITH_MODIFIERS.asRenderer() @JvmField val DEPRECATION_RENDERER = DescriptorRenderer.ONLY_NAMES_WITH_SHORT_TYPES.withOptions { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/TypeResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/TypeResolver.kt index 023f90369d6..1991bbae037 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/TypeResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/TypeResolver.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. + * Copyright 2010-2016 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. @@ -306,7 +306,7 @@ class TypeResolver( val arguments = resolveTypeProjections(c, ErrorUtils.createErrorType("No type").constructor, type.typeArguments) if (!arguments.isEmpty()) { - c.trace.report(WRONG_NUMBER_OF_TYPE_ARGUMENTS.on(type.typeArgumentList!!, 0)) + c.trace.report(TYPE_ARGUMENTS_NOT_ALLOWED.on(type.typeArgumentList!!, "for type parameters")) } val containing = typeParameter.containingDeclaration @@ -445,7 +445,10 @@ class TypeResolver( if (currentArguments.size != currentParameters.size) { c.trace.report( - WRONG_NUMBER_OF_TYPE_ARGUMENTS.on(qualifierPart.typeArguments ?: qualifierPart.expression, currentParameters.size)) + WRONG_NUMBER_OF_TYPE_ARGUMENTS.on( + qualifierPart.typeArguments ?: qualifierPart.expression, currentParameters.size, classDescriptorChain[index] + ) + ) return null } @@ -461,7 +464,7 @@ class TypeResolver( for (qualifierPart in nonClassQualifierParts) { if (qualifierPart.typeArguments != null) { - c.trace.report(WRONG_NUMBER_OF_TYPE_ARGUMENTS.on(qualifierPart.typeArguments, 0)) + c.trace.report(TYPE_ARGUMENTS_NOT_ALLOWED.on(qualifierPart.typeArguments, "here")) return null } } @@ -471,7 +474,7 @@ class TypeResolver( val typeParametersToSpecify = parameters.subList(result.size, parameters.size).takeWhile { it.original.containingDeclaration is ClassDescriptor } if (typeParametersToSpecify.any { parameter -> !parameter.isDeclaredInScope(c) }) { - c.trace.report(WRONG_NUMBER_OF_TYPE_ARGUMENTS.on(qualifierParts.last().expression, parameters.size)) + c.trace.report(WRONG_NUMBER_OF_TYPE_ARGUMENTS.on(qualifierParts.last().expression, parameters.size, classDescriptor)) return null } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CandidateResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CandidateResolver.kt index f909a2b808c..13166fdaf28 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CandidateResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CandidateResolver.kt @@ -135,7 +135,7 @@ class CandidateResolver( if (expectedTypeArgumentCount != jetTypeArguments.size) { candidateCall.addStatus(OTHER_ERROR) - tracing.wrongNumberOfTypeArguments(trace, expectedTypeArgumentCount) + tracing.wrongNumberOfTypeArguments(trace, expectedTypeArgumentCount, candidateDescriptor) } else { checkGenericBoundsInAFunctionCall(jetTypeArguments, typeArguments, candidateDescriptor, substitutor, trace) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/AbstractTracingStrategy.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/AbstractTracingStrategy.java index a036e5d1248..dc52f9f316e 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/AbstractTracingStrategy.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/AbstractTracingStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. + * Copyright 2010-2016 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. @@ -103,14 +103,13 @@ public abstract class AbstractTracingStrategy implements TracingStrategy { } @Override - public void wrongNumberOfTypeArguments(@NotNull BindingTrace trace, int expectedTypeArgumentCount) { + public void wrongNumberOfTypeArguments( + @NotNull BindingTrace trace, int expectedTypeArgumentCount, @NotNull CallableDescriptor descriptor + ) { KtTypeArgumentList typeArgumentList = call.getTypeArgumentList(); - if (typeArgumentList != null) { - trace.report(WRONG_NUMBER_OF_TYPE_ARGUMENTS.on(typeArgumentList, expectedTypeArgumentCount)); - } - else { - trace.report(WRONG_NUMBER_OF_TYPE_ARGUMENTS.on(reference, expectedTypeArgumentCount)); - } + trace.report(WRONG_NUMBER_OF_TYPE_ARGUMENTS.on( + typeArgumentList != null ? typeArgumentList : reference, expectedTypeArgumentCount, descriptor + )); } @Override diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/TracingStrategy.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/TracingStrategy.java index 4056edc3183..2c9d699fad1 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/TracingStrategy.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/TracingStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. + * Copyright 2010-2016 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. @@ -67,7 +67,7 @@ public interface TracingStrategy { public void noValueForParameter(@NotNull BindingTrace trace, @NotNull ValueParameterDescriptor valueParameter) {} @Override - public void wrongNumberOfTypeArguments(@NotNull BindingTrace trace, int expectedTypeArgumentCount) {} + public void wrongNumberOfTypeArguments(@NotNull BindingTrace trace, int expectedTypeArgumentCount, @NotNull CallableDescriptor descriptor) {} @Override public void ambiguity(@NotNull BindingTrace trace, @NotNull Collection> descriptors) {} @@ -132,7 +132,11 @@ public interface TracingStrategy { void noValueForParameter(@NotNull BindingTrace trace, @NotNull ValueParameterDescriptor valueParameter); - void wrongNumberOfTypeArguments(@NotNull BindingTrace trace, int expectedTypeArgumentCount); + void wrongNumberOfTypeArguments( + @NotNull BindingTrace trace, + int expectedTypeArgumentCount, + @NotNull CallableDescriptor descriptor + ); void ambiguity(@NotNull BindingTrace trace, @NotNull Collection> descriptors); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/TracingStrategyForImplicitConstructorDelegationCall.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/TracingStrategyForImplicitConstructorDelegationCall.kt index d5d76abdbad..76a37bf73d6 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/TracingStrategyForImplicitConstructorDelegationCall.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/TracingStrategyForImplicitConstructorDelegationCall.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. + * Copyright 2010-2016 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. @@ -126,7 +126,7 @@ class TracingStrategyForImplicitConstructorDelegationCall( unexpectedError("noReceiverAllowed") } - override fun wrongNumberOfTypeArguments(trace: BindingTrace, expectedTypeArgumentCount: Int) { + override fun wrongNumberOfTypeArguments(trace: BindingTrace, expectedTypeArgumentCount: Int, descriptor: CallableDescriptor) { unexpectedError("wrongNumberOfTypeArguments") } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ControlStructureTypingUtils.java b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ControlStructureTypingUtils.java index 4ac84c171ae..b878bfa15f8 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ControlStructureTypingUtils.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ControlStructureTypingUtils.java @@ -542,7 +542,7 @@ public class ControlStructureTypingUtils { } @Override - public void wrongNumberOfTypeArguments(@NotNull BindingTrace trace, int expectedTypeArgumentCount) { + public void wrongNumberOfTypeArguments(@NotNull BindingTrace trace, int expectedTypeArgumentCount, @NotNull CallableDescriptor descriptor) { logError(); } diff --git a/compiler/testData/diagnostics/tests/PackageQualified.kt b/compiler/testData/diagnostics/tests/PackageQualified.kt index 4ff3dc30f9f..4e859691e7c 100644 --- a/compiler/testData/diagnostics/tests/PackageQualified.kt +++ b/compiler/testData/diagnostics/tests/PackageQualified.kt @@ -12,7 +12,7 @@ package foobar.a package foobar abstract class Foo() { - abstract val x : T + abstract val x : T } // FILE: b.kt diff --git a/compiler/testData/diagnostics/tests/generics/argumentsForT.kt b/compiler/testData/diagnostics/tests/generics/argumentsForT.kt index 603950448eb..7076cec9963 100644 --- a/compiler/testData/diagnostics/tests/generics/argumentsForT.kt +++ b/compiler/testData/diagnostics/tests/generics/argumentsForT.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -fun foo(t: T) {} +fun foo(t: T) {} interface A class B -fun foo1(t: TString>>) {} \ No newline at end of file +fun foo1(t: TString>>) {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedTypesResolution.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedTypesResolution.kt index 81223af0895..8ec6d0585c3 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedTypesResolution.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedTypesResolution.kt @@ -48,4 +48,4 @@ fun error4(): Outer< fun error5(): Outer.Obj.Nested2.Inner5 = null!! fun error6(): Outer.Obj.Nested2.Inner5 = null!! -fun error7(): test.Outer.Obj.Nested2.Inner5 = null!! \ No newline at end of file +fun error7(): test.Outer.Obj.Nested2.Inner5 = null!! \ No newline at end of file diff --git a/idea/testData/checker/TypeArgumentsNotAllowed.kt b/idea/testData/checker/TypeArgumentsNotAllowed.kt new file mode 100644 index 00000000000..1925d3cc476 --- /dev/null +++ b/idea/testData/checker/TypeArgumentsNotAllowed.kt @@ -0,0 +1,7 @@ +package foo + +open class A + +fun f(t: T) {} + +fun use(b: foo.A) {} \ No newline at end of file diff --git a/idea/testData/checker/regression/kt9887.kt b/idea/testData/checker/regression/kt9887.kt new file mode 100644 index 00000000000..a1b076a4684 --- /dev/null +++ b/idea/testData/checker/regression/kt9887.kt @@ -0,0 +1,5 @@ +open class A() +class G() + + +class B : A<G>() \ No newline at end of file diff --git a/idea/testData/quickfix/addStarProjections/unqualifiedMapOneArg.kt b/idea/testData/quickfix/addStarProjections/unqualifiedMapOneArg.kt index a964e81394a..275eb099d63 100644 --- a/idea/testData/quickfix/addStarProjections/unqualifiedMapOneArg.kt +++ b/idea/testData/quickfix/addStarProjections/unqualifiedMapOneArg.kt @@ -1,5 +1,5 @@ // "class org.jetbrains.kotlin.idea.quickfix.AddStarProjectionsFix" "false" -// ERROR: 2 type arguments expected +// ERROR: 2 type arguments expected for interface Map defined in kotlin.collections public fun foo(a: Any) { a is Map } diff --git a/idea/testData/quickfix/addStarProjections/unqualifiedMapOneArg.kt.after b/idea/testData/quickfix/addStarProjections/unqualifiedMapOneArg.kt.after index 48d62b0822f..66c10ae9822 100644 --- a/idea/testData/quickfix/addStarProjections/unqualifiedMapOneArg.kt.after +++ b/idea/testData/quickfix/addStarProjections/unqualifiedMapOneArg.kt.after @@ -1,5 +1,5 @@ // "class org.jetbrains.kotlin.idea.quickfix.AddStarProjectionsFix" "false" -// ERROR: 2 type arguments expected +// ERROR: 2 type arguments expected for Map public fun foo(a: Any) { a is Map } diff --git a/idea/testData/quickfix/addStarProjections/when/unqualifiedMapOneArg.kt b/idea/testData/quickfix/addStarProjections/when/unqualifiedMapOneArg.kt index d9a79a3259b..b41f477f16d 100644 --- a/idea/testData/quickfix/addStarProjections/when/unqualifiedMapOneArg.kt +++ b/idea/testData/quickfix/addStarProjections/when/unqualifiedMapOneArg.kt @@ -1,5 +1,5 @@ // "class org.jetbrains.kotlin.idea.quickfix.AddStarProjectionsFix" "false" -// ERROR: 2 type arguments expected +// ERROR: 2 type arguments expected for interface Map defined in kotlin.collections public fun foo(a: Any) { when (a) { is Map -> {} diff --git a/idea/testData/quickfix/addStarProjections/when/unqualifiedMapOneArg.kt.after b/idea/testData/quickfix/addStarProjections/when/unqualifiedMapOneArg.kt.after index 70bffa0d704..51efe622f31 100644 --- a/idea/testData/quickfix/addStarProjections/when/unqualifiedMapOneArg.kt.after +++ b/idea/testData/quickfix/addStarProjections/when/unqualifiedMapOneArg.kt.after @@ -1,5 +1,5 @@ // "class org.jetbrains.kotlin.idea.quickfix.AddStarProjectionsFix" "false" -// ERROR: 2 type arguments expected +// ERROR: 2 type arguments expected for Map public fun foo(a: Any) { when (a) { is Map -> {} diff --git a/idea/testData/quickfix/createFromUsage/createSecondaryConstructor/callWithTypeArguments.kt b/idea/testData/quickfix/createFromUsage/createSecondaryConstructor/callWithTypeArguments.kt index 78642eda386..f3dcf3fe3e4 100644 --- a/idea/testData/quickfix/createFromUsage/createSecondaryConstructor/callWithTypeArguments.kt +++ b/idea/testData/quickfix/createFromUsage/createSecondaryConstructor/callWithTypeArguments.kt @@ -1,7 +1,7 @@ // "Create secondary constructor" "false" // ACTION: Add parameter to constructor 'A' // ACTION: Create function 'A' -// ERROR: No type arguments expected +// ERROR: No type arguments expected for constructor A() defined in A // ERROR: Too many arguments for public constructor A() defined in A class A diff --git a/idea/testData/quickfix/modifiers/kt10409.kt b/idea/testData/quickfix/modifiers/kt10409.kt index 879599fc765..c13ba529054 100644 --- a/idea/testData/quickfix/modifiers/kt10409.kt +++ b/idea/testData/quickfix/modifiers/kt10409.kt @@ -1,6 +1,6 @@ // "Make 'IterablePipeline' abstract" "true" // ERROR: 'pipe' overrides nothing -// ERROR: Type argument expected +// ERROR: One type argument expected for interface Pipeline defined in root package // Actually this test is about getting rid of assertion happenning while creating quick fixes // See KT-10409 diff --git a/idea/testData/quickfix/modifiers/kt10409.kt.after b/idea/testData/quickfix/modifiers/kt10409.kt.after index 50fffbbc0ef..7736c4f24b7 100644 --- a/idea/testData/quickfix/modifiers/kt10409.kt.after +++ b/idea/testData/quickfix/modifiers/kt10409.kt.after @@ -1,6 +1,6 @@ // "Make 'IterablePipeline' abstract" "true" // ERROR: 'pipe' overrides nothing -// ERROR: Type argument expected +// ERROR: One type argument expected for interface Pipeline defined in root package // Actually this test is about getting rid of assertion happenning while creating quick fixes // See KT-10409 diff --git a/idea/tests/org/jetbrains/kotlin/checkers/PsiCheckerTestGenerated.java b/idea/tests/org/jetbrains/kotlin/checkers/PsiCheckerTestGenerated.java index 188079ef034..cb71174648d 100644 --- a/idea/tests/org/jetbrains/kotlin/checkers/PsiCheckerTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/checkers/PsiCheckerTestGenerated.java @@ -343,6 +343,12 @@ public class PsiCheckerTestGenerated extends AbstractPsiCheckerTest { doTest(fileName); } + @TestMetadata("TypeArgumentsNotAllowed.kt") + public void testTypeArgumentsNotAllowed() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/TypeArgumentsNotAllowed.kt"); + doTest(fileName); + } + @TestMetadata("TypeParameterBounds.kt") public void testTypeParameterBounds() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/TypeParameterBounds.kt"); @@ -598,6 +604,12 @@ public class PsiCheckerTestGenerated extends AbstractPsiCheckerTest { doTest(fileName); } + @TestMetadata("kt9887.kt") + public void testKt9887() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/regression/kt9887.kt"); + doTest(fileName); + } + @TestMetadata("objectLiteralInSupertypeList.kt") public void testObjectLiteralInSupertypeList() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/regression/objectLiteralInSupertypeList.kt"); diff --git a/jps-plugin/testData/incremental/classHierarchyAffected/typeParameterListChanged/build.log b/jps-plugin/testData/incremental/classHierarchyAffected/typeParameterListChanged/build.log index 3064a4ed62a..9202c3caec9 100644 --- a/jps-plugin/testData/incremental/classHierarchyAffected/typeParameterListChanged/build.log +++ b/jps-plugin/testData/incremental/classHierarchyAffected/typeParameterListChanged/build.log @@ -51,16 +51,16 @@ End of files Exit code: ABORT ------------------------------------------ COMPILATION FAILED -Type argument expected -Type argument expected -Type argument expected +One type argument expected for class A defined in foo +One type argument expected for class A defined in foo +One type argument expected for class A defined in foo Type inference failed: Not enough information to infer parameter T in constructor A() Please specify it explicitly. Type inference failed: Not enough information to infer parameter T in constructor A() Please specify it explicitly. Type inference failed: Not enough information to infer parameter T in constructor A() Please specify it explicitly. -Type argument expected +One type argument expected for class A defined in foo ================ Step #2 =================