Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

illegal recursion with generic typeclass #4674

Closed
jcosborn opened this issue Aug 30, 2016 · 0 comments

Comments

Projects
None yet
4 participants
@jcosborn
Copy link
Contributor

commented Aug 30, 2016

Trying to declare an alias of an alias of a generic typeclass fails with an illegal recursion error. If the first alias was declared using the explicit generic parameter (Foo1x) or the second alias involves a type expression (Foo12x) then it works. This may be related to #4668.

type
  FooObj[T] = object
    v: T
  Foo1[T] = FooObj[T]
  Foo2 = FooObj
  Foo1x = Foo1
  Foo12x = Foo1 | Foo2
  Foo2x = Foo2  # Error: illegal recursion in type 'Foo2x'

@zah zah added the Type sections label May 13, 2017

@Yardanico Yardanico added the Generics label Oct 15, 2017

jcosborn added a commit to jcosborn/Nim that referenced this issue Oct 19, 2018

@Araq Araq closed this Oct 19, 2018

Araq added a commit that referenced this issue Oct 19, 2018

narimiran added a commit to narimiran/Nim that referenced this issue Oct 31, 2018

narimiran added a commit to narimiran/Nim that referenced this issue Nov 1, 2018

narimiran added a commit that referenced this issue Nov 1, 2018

narimiran added a commit that referenced this issue Nov 1, 2018

added test for #4674 (#9438)
(cherry picked from commit 3b1ade0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.