Skip to content

Instantly share code, notes, and snippets.

@chris-hatton
Last active November 9, 2015 19:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chris-hatton/1642f2e4f20e796d3203 to your computer and use it in GitHub Desktop.
Save chris-hatton/1642f2e4f20e796d3203 to your computer and use it in GitHub Desktop.
A test to see whether Swift's Generics system can carry through a self-derived type, which is possible, and often useful, in Java.
class A<SelfType : A<SelfType>>
{
}
class B : A<B> // Line fails to compile with: "'A' requires that 'B' inherit from 'A<B>'" even though it does
{
}
@GitHubbler
Copy link

yes! why?!
frustrating!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment