Skip to content

Instantly share code, notes, and snippets.

@chadaustin
Created October 6, 2016 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chadaustin/da8d6453ce8d95689cd00df3713a27f2 to your computer and use it in GitHub Desktop.
Save chadaustin/da8d6453ce8d95689cd00df3713a27f2 to your computer and use it in GitHub Desktop.
trait T1 {}
trait T2 {}
impl T1 Number {}
impl T2 Number {}
fun a<T: T1>(_: {...: T}) {
}
fun b<T: T2>(_: {...: T}) {
}
fun wantNumber(_: Number) {}
fun wantString(_: String) {}
fun f(q) {
a(q)
wantNumber(q.foo)
b(q)
wantString(q.bar)
}
fun main() {
_debug_type(f)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment