Skip to content

Internal assert when using a proc type with a single word as argument #1491

Open
@DiThi

Description

@DiThi

Specification

Syntax errors in proc types should give an explanation.

Example

# type X = object # turns out it does the same without this
var f: proc(X)

Actual Output

main.nim(2, 13) Fatal: Internal assert '' failed in semtypes.nim(1577, 15)
nim.nim(0)      nim
nim.nim(0)      handleCmdLine
main.nim(0)     mainCommand
main.nim(0)     compileToBackend
main.nim(0)     commandCompileToC
modules.nim(0)  compileProject
modules.nim(0)  compileModule
passes.nim(0)   processModule
passes.nim(0)   processTopLevelStmt
sem.nim(0)      myProcess
sem.nim(0)      semStmtAndGenerateGenerics
semstmts.nim(0) semStmt
semexprs.nim(0) semExprNoType
semexprs.nim(0) semExpr
semstmts.nim(0) semStmtList
semexprs.nim(0) semExpr
semstmts.nim(0) semConstLetOrVar
semstmts.nim(0) semNormalizedLetOrVar
semtypes.nim(0) semTypeNode
semtypes.nim(0) semProcTypeWithScope
semtypes.nim(0) semProcTypeNode
msgs.nim(0)     doInternalAssert
msgs.nim(0)     handleReport
msgs.nim(0)     quit

Expected Output

Something like:

Error: ':' expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcompiler/semRelated to semantic-analysis system of the compilergood first issueEasy-to-start-with issue with no in-depth knowledge or complex implementation required.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions