Skip to content

Commit

Permalink
[Tests] Reproduce #KT-75150
Browse files Browse the repository at this point in the history
  • Loading branch information
cypressious authored and Space Team committed Feb 17, 2025
1 parent 9290a1f commit 5d81476
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FILE: genericContextAmbiguity.kt
public abstract interface Describer<in T> : R|kotlin/Any| {
public abstract fun describe(t: R|T|): R|kotlin/String|

}
context(<unused var>: R|Describer<T>|)
public final fun <T> log(message: R|T|): R|kotlin/Unit| {
}
public final class A : R|kotlin/Any| {
public constructor(): R|A| {
super<R|kotlin/Any|>()
}

}
public final class B : R|kotlin/Any| {
public constructor(): R|B| {
super<R|kotlin/Any|>()
}

}
context(<unused var>: R|Describer<A>|, <unused var>: R|Describer<B>|)
public final fun bar(): R|kotlin/Unit| {
R|/log<Inapplicable(INAPPLICABLE): /log>#|<R|A|>(R|/A.A|())
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// RUN_PIPELINE_TILL: FRONTEND
// LANGUAGE: +ContextParameters
// ISSUE: KT-75150

interface Describer<in T> {
fun describe(t: T): String
}

context(_: Describer<T>)
fun <T> log(message: T) {}

class A
class B

context(_: Describer<A>, _: Describer<B>)
fun bar() {
<!AMBIGUOUS_CONTEXT_ARGUMENT!>log<!>(A())
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5d81476

Please sign in to comment.