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 assert when using a proc type with a single word as argument #1491

Open
DiThi opened this issue Jan 21, 2025 · 1 comment
Open

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

DiThi opened this issue Jan 21, 2025 · 1 comment
Labels
bug Something isn't working compiler/sem Related to semantic-analysis system of the compiler good first issue Easy-to-start-with issue with no in-depth knowledge or complex implementation required.

Comments

@DiThi
Copy link

DiThi commented Jan 21, 2025

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
@DiThi DiThi added the bug Something isn't working label Jan 21, 2025
@zerbina zerbina added good first issue Easy-to-start-with issue with no in-depth knowledge or complex implementation required. compiler/sem Related to semantic-analysis system of the compiler labels Jan 25, 2025
@zerbina
Copy link
Collaborator

zerbina commented Jan 25, 2025

Thanks for filing the issue.

For anyone looking into fixing the issue, the assertion should be removed and the subsequent signature lookup (for using support) should not trigger for routine types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler/sem Related to semantic-analysis system of the compiler good first issue Easy-to-start-with issue with no in-depth knowledge or complex implementation required.
Projects
None yet
Development

No branches or pull requests

2 participants