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
LTA error message when redeclaring a symbol with different type #4522
Comments
From @AlexDanielCode: Result: While compile-time “potential difficulties” part totally makes sense, You might think that using an integer can help: Result: In other words, it is exactly the same error… And not only you cannot Result: It looks totally less than awesome for me. Interestingly, if it was a |
From @moritzOn Sun Sep 06 20:58:11 2015, alex.jakimenko@gmail.com wrote:
You should note that the line "my Str $x = 'hello';" is actually line 3, so here it complains about the line where you assign the integer.
No, you gave it an Int. You are just confused about your line numbers. Note that redeclarations actually replace the previous declaration, at compile time. So at the time the initialization of the first declaration of $x is run, its type has already changed to Str. So my Int $x = "a"; Yes, this is surprising, which is why we emit a warning. Otherwise, the behavior seems correct. |
The RT System itself - Status changed from 'new' to 'open' |
@moritz - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#126008 (status was 'rejected')
Searchable as RT126008$
The text was updated successfully, but these errors were encountered: