Skip to content

Instantly share code, notes, and snippets.

@VladimirReshetnikov
Created June 27, 2015 00:38
Show Gist options
  • Save VladimirReshetnikov/b41dbc972557c0c35176 to your computer and use it in GitHub Desktop.
Save VladimirReshetnikov/b41dbc972557c0c35176 to your computer and use it in GitHub Desktop.
interface A {
fun f(x : Int) // No body
}
interface B<T> : A {
fun f(y: T)
}
interface C : B<Int>
fun foo(b : B<Int>, c : C) {
b.f(x = 1) // OK
b.f(y = 1) // OK
b.f(1) // Error: Overload resolution ambiguity
c.f(x = 1) // Error: No value passed for parameter y
c.f(y = 1) // OK
c.f(1) // OK
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment