Operator "or" in converter types seems to crash the compiler. #4537

oderwat opened this Issue Jul 29, 2016 · 0 comments


None yet

1 participant

oderwat commented Jul 29, 2016 edited

Using a converter like in the example below crashes with SIGSEV when trying to compile with the Javascript backend:

# nim js --d:nodejs

  Str = distinct string

when true:
  # crashes
  converter convert(s: string | cstring): Str = Str($s)
  # works!
  converter convert(s: string): Str = Str($s)
  converter convert(s: cstring): Str = Str($s)

proc echoStr(s: Str) = echo s.string


Trying to compile it with the C backend gives:

simple_crash.nim(7, 21) Error: internal error: metatype not eliminated

@oderwat oderwat closed this Jul 29, 2016
@oderwat oderwat changed the title from Operator "or" in converters types seem to crash the compiler. to Operator "or" in converter types seems to crash the compiler. Jul 29, 2016
@oderwat oderwat reopened this Jul 29, 2016
@Araq Araq added a commit that closed this issue Aug 2, 2016
@Araq Araq fixes #4537 4d5c002
@Araq Araq closed this in 4d5c002 Aug 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment