-
Notifications
You must be signed in to change notification settings - Fork 563
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
Warn on misleading Type(..) imports #1398
Conversation
|
||
withPosition :: SourceSpan -> ErrorMessage -> ErrorMessage | ||
withPosition pos (PositionedError _ err) = withPosition pos err | ||
withPosition pos err = PositionedError pos err |
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.
Also, is this right? It's what we had before, but if we're going top down surely it would be better to keep the original position, as it will be more specific.
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.
Yeah, I think we should always get the deepest position information we can.
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'll change it to do that then and see what effect it has, we can always revert it before releasing if it is worse.
Is it definitely hitting the Looks good otherwise 👍 |
I guess that would be the sensible explanation for why it's not... perhaps they're getting |
5a08a97
to
3a1bbc4
Compare
😭 I'll get the tests working on Windows before attempting to "fix" this any further. |
73d56d0
to
f2aed3e
Compare
@@ -529,6 +529,7 @@ resolveImport currentModule importModule exps imps impQual = | |||
isHidden hidden ref@(TypeRef _ _) = | |||
let | |||
checkTypeRef _ True _ = True | |||
checkTypeRef r acc (PositionedDeclarationRef _ _ h) = checkTypeRef r acc h |
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.
@paf31 this not existing was the cause of my woes, previously checkedRefs
below was deleting PositionedDeclarationRef
from the AST which meant this case wasn't needed...
Warn on misleading Type(..) imports
Resolves #1391.
@paf31 I can't figure out why the warning doesn't have position info though. It's probably something silly, can you take a look?