[FIR] KT-54978 Prohibit explicit type arguments in property accesses

- Add a checker which ensures that property accesses have no explicit
  type arguments. If an error on the property access's callee reference
  already exists, the new error is not reported in favor of the existing
  error, as the property access may have been intended to be a function
  call.
- `complicatedLTGT.fir.kt`: The underlying parser issue is not yet
  solved, which is why `x` is parsed as a property access with explicit
  type arguments.
- `reservedExpressionSyntax` tests: This new check makes a lot of the
  access expressions in these tests illegal, so valid lines have been
  added and invalid lines appropriately marked with
  `EXPLICIT_TYPE_ARGUMENTS_IN_PROPERTY_ACCESS` errors.

^KT-54978 fixed
This commit is contained in:
Marco Pennekamp
2022-11-23 16:04:07 +01:00
committed by teamcity
parent 4d20b43619
commit d4e6a4ad54
26 changed files with 281 additions and 16 deletions
@@ -18,10 +18,12 @@ package test {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public final fun </*0*/ T> kotlin.collections.List<T>.testCallable1(): () -> kotlin.Unit
public final fun </*0*/ T> kotlin.collections.List<T>.testCallable1a(): () -> kotlin.Unit
public final fun </*0*/ T> kotlin.collections.List<T>.testCallable2(): () -> kotlin.Unit
public final fun </*0*/ T> kotlin.collections.List<T>.testCallable3(): () -> kotlin.Unit
public final fun </*0*/ T> kotlin.collections.List<T>.testCallable4(): () -> kotlin.Unit
public final fun </*0*/ T> kotlin.collections.List<T>.testClassLiteral1(): kotlin.reflect.KClass<out kotlin.Int>
public final fun </*0*/ T> kotlin.collections.List<T>.testClassLiteral1a(): kotlin.reflect.KClass<out kotlin.Int>
public final fun </*0*/ T> kotlin.collections.List<T>.testClassLiteral2(): kotlin.reflect.KClass<out kotlin.Int?>
public final fun </*0*/ T> kotlin.collections.List<T>.testClassLiteral3(): kotlin.reflect.KClass<out kotlin.Int?>
public final fun </*0*/ T> kotlin.collections.List<T>.testUnresolved1(): [Error type: Return type for function cannot be resolved]