Skip to content
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

Updates to type annotation/assertion after discussion/review #167

Merged
merged 1 commit into from
Feb 24, 2019

Conversation

zuiderkwast
Copy link
Collaborator

#166 got merged so here are the discussed updates in a separate PR

@codecov-io
Copy link

codecov-io commented Feb 23, 2019

Codecov Report

Merging #167 into master will increase coverage by 0.15%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #167      +/-   ##
==========================================
+ Coverage   83.01%   83.17%   +0.15%     
==========================================
  Files           9        9              
  Lines        2126     2134       +8     
==========================================
+ Hits         1765     1775      +10     
+ Misses        361      359       -2
Impacted Files Coverage Δ
src/typechecker.erl 83.91% <100%> (+0.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5ee902a...2a4d3ce. Read the comment docs.

Copy link
Owner

@josefs josefs left a comment

Choose a reason for hiding this comment

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

Great stuff!

I apologize if you think I was a little trigger happy with merging your previous PR.

%% adjusts type checking accordingly. The macros are supplied only for
%% convenience.
%%
-compile({inline, ['::'/2, ':::'/2]}).
Copy link
Owner

Choose a reason for hiding this comment

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

It's really helpful that you've written this documentation. I think it would be even more helpful if you further clarified the distinction between :: and :::. Right now it's not clear which one does annotation and which does assertion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, that's true.

test/should_fail/annotated_types_fail.erl Show resolved Hide resolved
io:format("The type annotation ~p on line ~p is not a valid type~n",
[TypeStr, erl_anno:line(P)]);
[erl_pp:expr(TypeLit), line_no(TypeLit)]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

you could add maybe_format_column too

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe. I thought it can be done when column is added to all error messages in a uniform way. One function call format_location would be preferable.

@zuiderkwast
Copy link
Collaborator Author

I apologize if you think I was a little trigger happy with merging your previous PR.

No problem. The merged part can be used already. I'm happy you like it. :-)

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.

4 participants