-
Notifications
You must be signed in to change notification settings - Fork 33
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
Get Lint working on 0.6 #172
Conversation
There was some code incorrectly supposing that |
1 similar comment
All the tests are passing and I think this is ready to go after review! Once this is in I'll have another PR fixing up minor issues and cleaning up some loose ends. |
@@ -148,7 +148,7 @@ end | |||
msgs = lintstr(s) | |||
@test msgs[1].code == :E521 | |||
@test msgs[1].variable == "a" | |||
@test contains(msgs[1].message, "apparent type DataType is not a container type") | |||
@test contains(msgs[1].message, "apparent type Type") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the wording on this error message or change it to be more descriptive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message is actually the same. I had to change the test because it prints as Type{T}
on 0.5 or Type
on 0.6, and I didn't want to select which based off version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, going forward, we will want to standardize the error messages based off error codes, and then disassociate the testing of linting creating the right error code, and testing the error codes being associated with an appropriately descriptive message.
The first commit converts DataType to Type everywhere. This should always have been the case, but is especially important in 0.6, as many types like
Array
are nowUnionAll
s instead ofDataType
s.The second commit rewrites the version constraint code to not call
eval
. Not callingeval
is a good idea anyway, but is especially important in 0.6 due to the world age restrictions. The calling of new methods created witheval
is subject to world age restrictions in 0.6, and removing theeval
addresses that issue.The third commit changes from
typeof(x) == T
toisa(x, T)
in many places. 0.6 introduces newx isa T
syntax which would make sense to use in the future, and this is a first step toward that modernization.The fourth commit addresses the remaining, miscellaneous problems that prevent Lint from working properly on 0.6, and involves some updates to legacy code (this fixes several issues along the way). Overall, Lint should be better at detecting types. Once 0.4 support is dropped, large amounts of code can be removed.
The fifth commit (in progress) fixes breakage of 0.4 and 0.5 introduced by the first four commits.
Fixes #79
Fixes #137