KT-35811: Type parameter angle brackets followed by equal sign are parsed incorrectly if whitespace is missing

This commit is contained in:
Iven Krall
2022-03-26 18:40:15 +01:00
committed by teamcity
parent 8de4eb798c
commit ba5c85d6f2
21 changed files with 705 additions and 382 deletions
@@ -0,0 +1,14 @@
// FIR_IDENTICAL
// !LANGUAGE: +AllowExpressionAfterTypeReferenceWithoutSpacing
// ISSUE: KT-35811
class A<T>
val reportedProperty: A<String>=A()
fun reportedFunction(a: A<String>=A()): A<String>=a
val unreportedProperty0: A<String> =A()
fun unreportedFunction0(a: A<String> =A()): A<String> =A()
val unreportedProperty1: String=""
fun unreportedFunction1(a: Int=0): Int=a
@@ -0,0 +1,15 @@
package
public val reportedProperty: A<kotlin.String>
public val unreportedProperty0: A<kotlin.String>
public val unreportedProperty1: kotlin.String = ""
public fun reportedFunction(/*0*/ a: A<kotlin.String> = ...): A<kotlin.String>
public fun unreportedFunction0(/*0*/ a: A<kotlin.String> = ...): A<kotlin.String>
public fun unreportedFunction1(/*0*/ a: kotlin.Int = ...): kotlin.Int
public final class A</*0*/ T> {
public constructor A</*0*/ T>()
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
}
@@ -0,0 +1,13 @@
// !LANGUAGE: -AllowExpressionAfterTypeReferenceWithoutSpacing
// ISSUE: KT-35811
class A<T>
val reportedProperty: A<String>=A()
fun reportedFunction(a: A<String>=A()): A<String>=a
val unreportedProperty0: A<String> =A()
fun unreportedFunction0(a: A<String> =A()): A<String> =A()
val unreportedProperty1: String=""
fun unreportedFunction1(a: Int=0): Int=a
@@ -0,0 +1,13 @@
// !LANGUAGE: -AllowExpressionAfterTypeReferenceWithoutSpacing
// ISSUE: KT-35811
class A<T>
val reportedProperty: A<String><!EXPRESSION_AFTER_TYPE_REFERENCE_WITHOUT_SPACING_NOT_ALLOWED!>=<!>A()
fun reportedFunction(a: A<String><!EXPRESSION_AFTER_TYPE_REFERENCE_WITHOUT_SPACING_NOT_ALLOWED!>=<!>A()): A<String><!EXPRESSION_AFTER_TYPE_REFERENCE_WITHOUT_SPACING_NOT_ALLOWED!>=<!>a
val unreportedProperty0: A<String> =A()
fun unreportedFunction0(a: A<String> =A()): A<String> =A()
val unreportedProperty1: String=""
fun unreportedFunction1(a: Int=0): Int=a
@@ -0,0 +1,15 @@
package
public val reportedProperty: A<kotlin.String>
public val unreportedProperty0: A<kotlin.String>
public val unreportedProperty1: kotlin.String = ""
public fun reportedFunction(/*0*/ a: A<kotlin.String> = ...): A<kotlin.String>
public fun unreportedFunction0(/*0*/ a: A<kotlin.String> = ...): A<kotlin.String>
public fun unreportedFunction1(/*0*/ a: kotlin.Int = ...): kotlin.Int
public final class A</*0*/ T> {
public constructor A</*0*/ T>()
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
}