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[T] + syntactic error in the for loop = compiler crash #12148

Closed
silent-observer opened this issue Sep 6, 2019 · 1 comment
Closed

Comments

@silent-observer
Copy link
Contributor

Weird compiler crash in latest version (including 0.20.2 and 0.20.99) involving static[T]

Example

proc f(x: static[int]) =
  for l in and @[1, 2, 3].items:
    discard

f(4)

Yes, I know that and is a typo, but shouldn't that cause normal error, not a crash?

Error

compiler\nim.nim(106) nim
compiler\nim.nim(83) handleCmdLine
compiler\cmdlinehelper.nim(98) loadConfigsAndRunMainCommand
compiler\main.nim(188) mainCommand
compiler\main.nim(92) commandCompileToC
compiler\modules.nim(144) compileProject
compiler\modules.nim(85) compileModule
compiler\passes.nim(210) processModule
compiler\passes.nim(86) processTopLevelStmt
compiler\sem.nim(601) myProcess
compiler\sem.nim(569) semStmtAndGenerateGenerics
compiler\semstmts.nim(2224) semStmt
compiler\semexprs.nim(987) semExprNoType
compiler\semexprs.nim(2735) semExpr
compiler\semstmts.nim(2164) semStmtList
compiler\semexprs.nim(2645) semExpr
compiler\semexprs.nim(968) semDirectOp
compiler\semexprs.nim(817) semOverloadedCallAnalyseEffects
compiler\semcall.nim(541) semOverloadedCall
compiler\semcall.nim(502) semResolvedCall
compiler\seminst.nim(388) generateInstance
compiler\seminst.nim(148) instantiateBody
compiler\semexprs.nim(1745) semProcBody
compiler\semexprs.nim(2735) semExpr
compiler\semstmts.nim(2164) semStmtList
compiler\semexprs.nim(2745) semExpr
compiler\semstmts.nim(868) semFor
compiler\semexprs.nim(77) semExprNoDeref
compiler\semexprs.nim(2657) semExpr
compiler\semexprs.nim(968) semDirectOp
compiler\semexprs.nim(814) semOverloadedCallAnalyseEffects
compiler\semcall.nim(533) semOverloadedCall
compiler\semcall.nim(335) resolveOverloads
compiler\semcall.nim(93) pickBestCandidate
compiler\sigmatch.nim(2522) matches
compiler\sigmatch.nim(2459) matchesAux
compiler\sigmatch.nim(2261) prepareOperand
compiler\semexprs.nim(49) semOperand
compiler\semexprs.nim(2607) semExpr
compiler\semexprs.nim(2657) semExpr
compiler\semexprs.nim(968) semDirectOp
compiler\semexprs.nim(817) semOverloadedCallAnalyseEffects
compiler\semcall.nim(533) semOverloadedCall
compiler\semcall.nim(385) resolveOverloads
compiler\semcall.nim(296) getMsgDiagnostic
compiler\lookups.nim(434) nextOverloadIter
lib\system\fatal.nim(39) sysFatal
Error: unhandled exception: 'sym' is not accessible using discriminant 'kind' of type 'TNode' [FieldError]

Additional Information

$ nim -v
Nim Compiler Version 0.20.99 [Windows: i386]
Compiled at 2019-09-06
Copyright (c) 2006-2019 by Andreas Rumpf
@pmetras
Copy link

pmetras commented Dec 5, 2019

Still present in 1.0.4

@Araq Araq added the Severe label Dec 6, 2019
Araq added a commit that referenced this issue Dec 12, 2019
@Araq Araq closed this as completed in 22b2684 Dec 12, 2019
narimiran pushed a commit to narimiran/Nim that referenced this issue Dec 16, 2019
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

4 participants