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

Fix printing of TypeVar with lower bound. #16221

Merged
merged 1 commit into from
May 6, 2016
Merged

Fix printing of TypeVar with lower bound. #16221

merged 1 commit into from
May 6, 2016

Conversation

yuyichao
Copy link
Contributor

@yuyichao yuyichao commented May 5, 2016

  • Also make printing of parametrized type less verbose when inside method
    signature or type parameter.
  • Add comment about the show method for TypeVar and DataType.
  • Add test for printing TypeVar, method signature and primary types in type
    parameter.

Fix the issue noticed in https://github.com/JuliaLang/julia/pull/15753/files/19d44318d14e4a880f3eaedf6c29f4fdf310c83a#r59119519 .

# existing `tvar_env` in order to resolve the ambiguity when printing a
# method signature.
# i.e. `foo{T,N}(::Array{T,N}, ::Array)` should be printed as
# `foo{T,N}(::Array{T,N}, ::Array{T<:Any,N<:Any})`
Copy link
Member

Choose a reason for hiding this comment

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

That's pretty verbose. Might be better to print Array as Array.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kind of agree... This comment is just describing the intent of fff2b9a so that I can figure out what is the right fix.

To get a less verbose printing, should we print Array as Array in all cases (currently it prints as Array{T,N}) or only for method signatures?

Also what about types with partially specified parameters? How should ::Vector be printed (I don't think we store the name of the TypeConstructor so we have to print it as Array{...})?

@yuyichao
Copy link
Contributor Author

yuyichao commented May 5, 2016

@JeffBezanson How about this version.

@JeffBezanson
Copy link
Member

Looks good.

* Also make printing of parametrized type less verbose when inside method
  signature or type parameter.
* Add comment about the `show` method for `TypeVar` and `DataType`.
* Add test for printing `TypeVar`, method signature and primary types in type
  parameter.
@yuyichao yuyichao merged commit 84d7bea into master May 6, 2016
@yuyichao yuyichao deleted the yyc/show-tvar branch May 6, 2016 02:41
@StefanKarpinski StefanKarpinski mentioned this pull request May 6, 2016
32 tasks
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.

2 participants