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

newruntime: internal error when initializing a proc variable #11533

Closed
muiroc opened this issue Jun 18, 2019 · 0 comments

Comments

@muiroc
Copy link

commented Jun 18, 2019

Works without --newruntime

Example

proc say = echo "hello"

# Error: internal error: genAssignment: tyNil
var err0: proc() = say
err0()

var ok0: proc()
ok0 = say
ok0()

var ok1 = say
ok1()

Current Output

edit: nightly nim_temp:
Error: internal error: genAssignment: tyNil
Traceback (most recent call last)
c:\nim\compiler\nim.nim(98) nim
c:\nim\compiler\nim.nim(75) handleCmdLine
c:\nim\compiler\cmdlinehelper.nim(92) loadConfigsAndRunMainCommand
c:\nim\compiler\main.nim(194) mainCommand
c:\nim\compiler\main.nim(90) commandCompileToC
c:\nim\compiler\modules.nim(147) compileProject
c:\nim\compiler\modules.nim(88) compileModule
c:\nim\compiler\passes.nim(197) processModule
c:\nim\compiler\passes.nim(86) processTopLevelStmt
c:\nim\compiler\cgen.nim(1883) myProcess
c:\nim\compiler\ccgstmts.nim(1284) genStmts
c:\nim\compiler\ccgexprs.nim(2633) expr
c:\nim\compiler\ccgexprs.nim(2421) genStmtList
c:\nim\compiler\ccgstmts.nim(1284) genStmts
c:\nim\compiler\ccgexprs.nim(2681) expr
c:\nim\compiler\ccgstmts.nim(1026) genTry
c:\nim\compiler\ccgexprs.nim(2633) expr
c:\nim\compiler\ccgexprs.nim(2410) genStmtList
c:\nim\compiler\ccgstmts.nim(1284) genStmts
c:\nim\compiler\ccgexprs.nim(2633) expr
c:\nim\compiler\ccgexprs.nim(2421) genStmtList
c:\nim\compiler\ccgstmts.nim(1284) genStmts
c:\nim\compiler\ccgexprs.nim(2597) expr
c:\nim\compiler\ccgcalls.nim(557) genCall
c:\nim\compiler\ccgcalls.nim(182) genPrefixCall
c:\nim\compiler\ccgcalls.nim(165) genArg
c:\nim\compiler\cgen.nim(612) initLocExprSingleUse
c:\nim\compiler\ccgexprs.nim(2651) expr
c:\nim\compiler\ccgexprs.nim(2365) genClosure
c:\nim\compiler\cgen.nim(599) initLocExpr
c:\nim\compiler\ccgexprs.nim(2632) expr
c:\nim\compiler\ccgexprs.nim(2410) genStmtListExpr
c:\nim\compiler\ccgstmts.nim(1284) genStmts
c:\nim\compiler\ccgexprs.nim(2663) expr
c:\nim\compiler\ccgstmts.nim(1273) genAsgn
c:\nim\compiler\ccgstmts.nim(140) loadInto
c:\nim\compiler\ccgexprs.nim(2581) expr
c:\nim\compiler\ccgexprs.nim(441) putIntoDest
c:\nim\compiler\ccgexprs.nim(365) genAssignment
c:\nim\compiler\msgs.nim(549) internalError
c:\nim\compiler\msgs.nim(428) rawMessage
c:\nim\compiler\msgs.nim(425) rawMessage
c:\nim\compiler\msgs.nim(341) handleError
c:\nim\compiler\msgs.nim(331) quit

Expected Output

hello
hello
hello

Possible Solution

Additional Information

EDIT: nightly
Nim Compiler Version 0.20.1 [Windows: amd64]
git hash: 464142683ff8622e35248841165a2c8b6227f6d4

compiles fine without --newruntime
this other issue mentions procs and genAssignment: tyNil:
#5015

@Araq Araq closed this in 0db3c67 Jun 21, 2019

narimiran added a commit that referenced this issue Jun 27, 2019

closes #11533
(cherry picked from commit 0db3c67)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.