Skip to content

Add position information to type warning#3174

Merged
hdgarrood merged 1 commit intopurescript:masterfrom
b123400:type-dec-var-position
Dec 20, 2017
Merged

Add position information to type warning#3174
hdgarrood merged 1 commit intopurescript:masterfrom
b123400:type-dec-var-position

Conversation

@b123400
Copy link
Copy Markdown
Contributor

@b123400 b123400 commented Dec 19, 2017

No description provided.

@hdgarrood
Copy link
Copy Markdown
Contributor

Could you please explain how you have tested this?

@kritzcreek
Copy link
Copy Markdown
Member

Yeah, it would be nice if you could come up with an example, show the bad error message on current master and then the improved one after your change. Thanks!

@b123400
Copy link
Copy Markdown
Contributor Author

b123400 commented Dec 20, 2017

Oops sorry I was in a hurry yesterday. For example when I have code like this:

main :: forall a. Int
main = 1

It will compile with warning:

in module Main
Type variable e is ambiguous, since it is unused in the polymorphic type which introduces it.
in type declaration for main

After this PR, the warning becomes:

in module Main
at src/Main.purs line 3, column 1 - line 3, column 22
Type variable e is ambiguous, since it is unused in the polymorphic type which introduces it.
in type declaration for main

It's especially useful for IDE integration.

Copy link
Copy Markdown
Member

@kritzcreek kritzcreek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@hdgarrood hdgarrood merged commit 31de60b into purescript:master Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants