Skip to content

Fix #1643: More robust untpd.New #1660

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

Merged
merged 2 commits into from
Nov 6, 2016
Merged

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Nov 5, 2016

Also, disallow wildcard arguments in new.

Review by @smarter.

We assumed that argument types in an untpd.New are never wildcards but
in the face of errors that is not true.
These might lead to bad bounds if unchecked.
Scalac disallows them also, but with a confusing error message
("class type expected" on the class).
Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

tpt1 match {
case AppliedTypeTree(_, targs) =>
for (targ @ TypeBoundsTree(_, _) <- targs)
ctx.error("type argument must be fully defined", targ.pos)
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be better to not introduce new string error messages and to make a new error message class by following Felix's guide instead: #1589

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed in principle, but I think it's best to leave that to others who are already in it. Crafting a good error message takes time. But my goal here is to clear the backlog of fuzzing errors, so I want to move quickly.

@smarter
Copy link
Member

smarter commented Nov 6, 2016

Alright, updated #1589 with the new error.

@smarter smarter merged commit 913f76a into scala:master Nov 6, 2016
@allanrenucci allanrenucci deleted the fix-#1643 branch December 14, 2017 16:59
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