[FIR] Properly create type ref for error type in various places

This commit is contained in:
Dmitriy Novozhilov
2023-02-01 16:40:04 +02:00
committed by Space Team
parent ad3ae0ff69
commit e9204521a9
25 changed files with 36 additions and 61 deletions
@@ -6,5 +6,5 @@ FILE: ambiguityWhenNoApplicableCallableReferenceCandidate.kt
public final fun <T> bar(f: R|(T) -> kotlin/Unit|): R|kotlin/Unit| {
}
public final fun test(): R|kotlin/Unit| {
R|/bar<CS errors: /bar>#|<R|ERROR CLASS: Cannot infer argument for type parameter T|>(::<Ambiguity: foo, [/foo, /foo]>#)
R|/bar<CS errors: /bar>#|<<ERROR TYPE REF: Cannot infer argument for type parameter T>>(::<Ambiguity: foo, [/foo, /foo]>#)
}
@@ -30,14 +30,14 @@ FILE: chooseCallableReferenceDependingOnInferredReceiver.kt
^bar R|kotlin/TODO|()
}
public final fun test(): R|kotlin/Unit| {
R|/myWith<CS errors: /myWith>#|<R|A|, R|ERROR CLASS: Cannot infer argument for type parameter R|>(R|/A.A|(), <L> = myWith@fun R|A|.<anonymous>(): <ERROR TYPE REF: Cannot infer argument for type parameter R> <inline=Inline, kind=UNKNOWN> {
R|/myWith<CS errors: /myWith>#|<R|A|, <ERROR TYPE REF: Cannot infer argument for type parameter R>>(R|/A.A|(), <L> = myWith@fun R|A|.<anonymous>(): <ERROR TYPE REF: Cannot infer argument for type parameter R> <inline=Inline, kind=UNKNOWN> {
lval t1: R|A| = R|/bar|<R|A|>(::R|/A.foo|)
lval t2: R|A| = R|/bar|<R|A|>(::R|/A.baz|)
^ R|/myWith|<R|B|, R|ERROR CLASS: Cannot infer argument for type parameter R|>(R|/B.B|(), <L> = myWith@fun R|B|.<anonymous>(): <ERROR TYPE REF: Cannot infer argument for type parameter R> <inline=Inline, kind=UNKNOWN> {
^ R|/myWith|<R|B|, <ERROR TYPE REF: Cannot infer argument for type parameter R>>(R|/B.B|(), <L> = myWith@fun R|B|.<anonymous>(): <ERROR TYPE REF: Cannot infer argument for type parameter R> <inline=Inline, kind=UNKNOWN> {
lval a: R|A| = R|/bar|<R|A|>(::R|/A.foo|)
lval b: R|B| = R|/bar|<R|B|>(::R|/B.foo|)
lval t3: R|B| = R|/bar|<R|B|>(::R|/B.baz|)
^ R|/bar|<R|ERROR CLASS: Cannot infer argument for type parameter T|>(::<Ambiguity: foo, [/B.foo, /B.foo]>#)
^ R|/bar|<<ERROR TYPE REF: Cannot infer argument for type parameter T>>(::<Ambiguity: foo, [/B.foo, /B.foo]>#)
}
)
}
@@ -21,5 +21,5 @@ FILE: eagerAndPostponedCallableReferences.kt
lval a4: R|B| = R|/foo|<R|B|>(::R|/multiple|, ::R|/singleB|)
lval a5: R|A| = R|/foo|<R|A|>(::R|/singleA|, ::R|/singleA|)
lval a6: R|it(A & B)| = R|/foo|<R|it(A & B)|>(::R|/singleA|, ::R|/singleB|)
R|/foo<CS errors: /foo>#|<R|ERROR CLASS: Cannot infer argument for type parameter T|>(::<Ambiguity: multiple, [/multiple, /multiple]>#, ::<Ambiguity: multiple, [/multiple, /multiple]>#)
R|/foo<CS errors: /foo>#|<<ERROR TYPE REF: Cannot infer argument for type parameter T>>(::<Ambiguity: multiple, [/multiple, /multiple]>#, ::<Ambiguity: multiple, [/multiple, /multiple]>#)
}
@@ -9,7 +9,7 @@ FILE: implicitTypes.kt
^bar Int(1)
}
public final fun loop1(): R|(ERROR CLASS: Cannot infer argument for type parameter T) -> ERROR CLASS: Cannot infer argument for type parameter R| {
^loop1 R|/use<Inapplicable(INAPPLICABLE): /use>#|<R|ERROR CLASS: Cannot infer argument for type parameter T|, R|ERROR CLASS: Cannot infer argument for type parameter R|>(::<Unresolved reference: loop2>#)
^loop1 R|/use<Inapplicable(INAPPLICABLE): /use>#|<<ERROR TYPE REF: Cannot infer argument for type parameter T>, <ERROR TYPE REF: Cannot infer argument for type parameter R>>(::<Unresolved reference: loop2>#)
}
public final fun loop2(): <ERROR TYPE REF: cycle> {
^loop2 R|/loop1|()