Skip to content

Instantly share code, notes, and snippets.

@eernstg
Last active October 12, 2023 10:31
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 eernstg/ffa608c63f62ebb8f8fc1caf6b3569af to your computer and use it in GitHub Desktop.
Save eernstg/ffa608c63f62ebb8f8fc1caf6b3569af to your computer and use it in GitHub Desktop.
class A<X extends A<X>> {}
class B extends A<B> {}
class C extends B {}
void f<X extends A<X>>(X x) {}
void main() {
f<B>(C()); // OK.
f(C()); // Compile-time error: "Couldn't infer ..".
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment