fixes semantic error for int (Issue #1926)#2476
Conversation
anutosh491
left a comment
There was a problem hiding this comment.
Yeah if we've decided to return an error till we decide on what action we want to take for the int annotation, I think this should work !
| if( !type && raise_error ) { | ||
| throw SemanticError("Unsupported type annotation: " + var_annotation, loc); | ||
| if (var_annotation == "int") { | ||
| throw SemanticError(var_annotation + " type is not supported yet. " , loc); |
There was a problem hiding this comment.
Add a hint: "hint: use i8, i16, i32 or i64 for now". Lookup other place in the code how to add a hint.
There was a problem hiding this comment.
Please review the changes I have made.
certik
left a comment
There was a problem hiding this comment.
Excellent, thanks! Can you please also add a test for this error message?
|
Resolved Issue #1926 by refining the semantic error message for 'int'. Changes: |
certik
left a comment
There was a problem hiding this comment.
Excellent, thank you for this PR. I think the code looks great, very nice error message.
Issue Link: #1926
Changes:
Introduces a clear error message:
Context:
As discussed in this comment, this improvement enhances the usability of LPython.