You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERROR Compilation error - Traceback:
File '/home/luna/data/WebstormProjects/Kipper/test.kip', line 3, col 0:
var name: str = "Luna";
^^^^^^^^^^^^^^^^^^^^^^
IdentifierError: Redeclaration of variable 'name'.
FATAL Failed to compile 'test.kip'.
FATAL Encountered unexpected internal error:
InternalError: Failed to determine the declaration context for a declaration. Most likely the semantic analysis failed or the property was accessed too early during semantic analysis. - Report this bug to the developer using the traceback!
at VariableDeclaration.getScopeDeclaration (/home/luna/.local/share/pnpm/global/5/.pnpm/@kipper+core@0.10.1/node_modules/@kipper/core/lib/compiler/ast/nodes/definitions.js:27:19)
at VariableDeclaration.getScopeDeclaration (/home/luna/.local/share/pnpm/global/5/.pnpm/@kipper+core@0.10.1/node_modules/@kipper/core/lib/compiler/ast/nodes/definitions.js:186:22)
at VariableDeclaration.<anonymous> (/home/luna/.local/share/pnpm/global/5/.pnpm/@kipper+core@0.10.1/node_modules/@kipper/core/lib/compiler/ast/nodes/definitions.js:227:78)
at Generator.next (<anonymous>)
at /home/luna/.local/share/pnpm/global/5/.pnpm/tslib@2.4.1/node_modules/tslib/tslib.js:118:75
at new Promise (<anonymous>)
at Object.__awaiter (/home/luna/.local/share/pnpm/global/5/.pnpm/tslib@2.4.1/node_modules/tslib/tslib.js:114:16)
at VariableDeclaration.primarySemanticTypeChecking (/home/luna/.local/share/pnpm/global/5/.pnpm/@kipper+core@0.10.1/node_modules/@kipper/core/lib/compiler/ast/nodes/definitions.js:218:24)
at VariableDeclaration.<anonymous> (/home/luna/.local/share/pnpm/global/5/.pnpm/@kipper+core@0.10.1/node_modules/@kipper/core/lib/compiler/ast/analysable-ast-node.js:103:32)
at Generator.next (<anonymous>)
To simply the reproduction case, you can simply write:
varname: str="Luna";varname: str="Luna";
Expected Behavior
The compiler should only return the redeclaration errors and not the internal error.
Steps To Reproduce
Define a variable with a value assigned of any type.
Create another variable definition with a value of the same type.
For example:
varname: str="Luna";varname: str="Luna";
Environment
Kipper: 0.10.1
Environment: Node.js v18.15.0
Operating System: Arch Linux with Kernel 6.1.27-1-lts
The text was updated successfully, but these errors were encountered:
The bug was caused by the variable declaration still performing type checking after the semantic error (as expected), but not ensuring the scope declaration is present.
Is there an existing issue for this?
I am following the documentation's guide
This issue exists in the latest version
Current Behavior
Using the following code, the compiler generates an
InternalError
reporting a failure in the resolution of the internal scope declaration:The resulting error:
To simply the reproduction case, you can simply write:
Expected Behavior
The compiler should only return the redeclaration errors and not the internal error.
Steps To Reproduce
Environment
The text was updated successfully, but these errors were encountered: