-
-
Notifications
You must be signed in to change notification settings - Fork 672
Print better compiler error for duplicate identifiers #793
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
Comments
Me and @karzanbotani are currently working this fix now, is there a set way you want it to error? This is the current message we have: ERROR: AssertionError: Duplicate instance member: 'field' in file 'test.ts', line: 3 column: 15
at assert (*/assemblyscript/std/portable/index.js:184:9)
at Compiler.compileTopLevelStatement (*/assemblyscript/src/compiler.ts:1635:11)
at Compiler.compileFile (*/assemblyscript/src/compiler.ts:759:12)
at Compiler.compile (*/assemblyscript/src/compiler.ts:366:14)
at Object.compileProgram (*/assemblyscript/src/index.ts:146:41)
at stats.compileTime.measure (*/assemblyscript/cli/asc.js:591:31)
at measure (*/assemblyscript/cli/asc.js:929:3)
at Object.main (*/assemblyscript/cli/asc.js:590:26)
at Object.<anonymous> (*/assemblyscript/bin/asc:21:26)
at Module._compile (internal/modules/cjs/loader.js:688:30) |
@DanielRX Great! But instead of EDIT |
Noted, as a side point, we are going to add |
This is emitting a diagnostic with a related range now, indicating both the initial declaration and the duplicate one. |
But this should be valid:
Expected compiler error:
Actual:
The text was updated successfully, but these errors were encountered: