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

Static: compiler internal error: getTypeDescAux(tyNone) #7231

Closed
mratsim opened this issue Feb 17, 2018 · 3 comments
Closed

Static: compiler internal error: getTypeDescAux(tyNone) #7231

mratsim opened this issue Feb 17, 2018 · 3 comments

Comments

@mratsim
Copy link
Collaborator

mratsim commented Feb 17, 2018

Continuing on #7230, I also got this compiler crash while trying to use a proc:

import macros


proc getBase*(bits: static[int]): typedesc =
  if bits == 128:
    result = newTree(nnkBracketExpr, ident("MpUintBase"), ident("uint64"))
  else:
    result = newTree(nnkBracketExpr, ident("MpUintBase"), ident("uint32"))

type
  BaseUint* = SomeUnsignedInt or MpUintBase
  MpUintBase*[BaseUint] = object
      lo*, hi*: BaseUint

  MpUint*[bits: static[int]] = getbase(bits)
Error: internal error: getTypeDescAux(tyNone)
No stack traceback available
To create a stacktrace, rerun compilation with ./koch temp c <file>
@andreaferretti
Copy link
Collaborator

Shouldn't you use a macro there? Is just returning a typedesc from a proc supported?

@mratsim
Copy link
Collaborator Author

mratsim commented Feb 19, 2018

I tried both (see the linked bug). In any case the VM should not crash.

@Araq Araq added this to the v1 milestone Jun 8, 2018
@mratsim
Copy link
Collaborator Author

mratsim commented Aug 8, 2018

Works for me now, closing.

@mratsim mratsim closed this as completed Aug 8, 2018
Araq pushed a commit that referenced this issue Aug 8, 2018
* Add tests to confirm #7231 is fixed.

* Add test for closed #6137

* Add test for #7141
timotheecour pushed a commit to timotheecour/Nim that referenced this issue Aug 8, 2018
* Add tests to confirm nim-lang#7231 is fixed.

* Add test for closed nim-lang#6137

* Add test for nim-lang#7141
timotheecour pushed a commit to timotheecour/Nim that referenced this issue Aug 8, 2018
* Add tests to confirm nim-lang#7231 is fixed.

* Add test for closed nim-lang#6137

* Add test for nim-lang#7141
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants