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

internal error: compiler/semobjconstr.nim(324, 20) example #15111

Closed
tersec opened this issue Jul 29, 2020 · 0 comments
Closed

internal error: compiler/semobjconstr.nim(324, 20) example #15111

tersec opened this issue Jul 29, 2020 · 0 comments

Comments

@tersec
Copy link
Contributor

tersec commented Jul 29, 2020

A syntax error causes an internal compiler error.

Example

type
  Foo* = enum
    Baz = "foobar"

  Bar* = object
    case foobar*: Foo
    of Baz:

when isMainModule:
  discard

Current Output

please check whether the problem still exists in git head before posting,
see rebuilding the compiler.

$ bin/nim c testcase.nim
Hint: used config file 'config/nim.cfg' [Conf]
Hint: used config file 'config/config.nims' [Conf]
....
Error: internal error: compiler/semobjconstr.nim(324, 20)
No stack traceback available
$ bin/nim --version
Nim Compiler Version 1.3.5 [Linux: amd64]
Compiled at 2020-07-29
Copyright (c) 2006-2020 by Andreas Rumpf

git hash: 196e747df150ace81e7f4c01253128d4a89f03c7
active boot switches: -d:release
$ git log | head -n3
commit 196e747df150ace81e7f4c01253128d4a89f03c7
Author: c-blake <c-blake@users.noreply.github.com>
Date:   Wed Jul 29 05:19:02 2020 -0400

Expected Output

Not causing an internal error.

Additional Information

It exists back to 1.0.4 at least:

$ nim c testcase.nim
Hint: used config file '/etc/nim/nim.cfg' [Conf]
Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
Hint: testcase1 [Processing]
Error: internal error: (filename: "semobjconstr.nim", line: 324, column: 19)
No stack traceback available
To create a stacktrace, rerun compilation with ./koch temp c <file>
$ nim --version
Nim Compiler Version 1.2.4 [Linux: amd64]
Compiled at 2020-08-09
Copyright (c) 2006-2020 by Andreas Rumpf

active boot switches: -d:release
$ nim c testcase.nim
Hint: used config file '/etc/nim/nim.cfg' [Conf]
Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
Hint: testcase1 [Processing]
Error: internal error: (filename: "semstmts.nim", line: 1276, column: 19)
No stack traceback available
To create a stacktrace, rerun compilation with ./koch temp c <file>
$ nim --version
Nim Compiler Version 1.0.4 [Linux: amd64]
Compiled at 2020-02-04
Copyright (c) 2006-2019 by Andreas Rumpf

active boot switches: -d:release
@Clyybber Clyybber added Invalid Code Acceptance Everything related to compiler not complaining about invalid code Error Messages and removed Invalid Code Acceptance Everything related to compiler not complaining about invalid code labels Jul 29, 2020
Araq added a commit that referenced this issue Jul 31, 2020
@Araq Araq closed this as completed in 4ab6887 Aug 1, 2020
mildred pushed a commit to mildred/Nim that referenced this issue Jan 11, 2021
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