Skip to content

Drop named type parameters in classes #2050

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 3 commits into from
Mar 5, 2017

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Mar 4, 2017

Drop the [type T] syntax, and what's associated to make it work.

Motivation: It's an alternative way of doing things for which there seems
to be little need. The implementation was provisional and bitrotted during
the various iterations to introduce higher-kinded types. So in the end the
complxity-cost for language and compiler was not worth the added benefit
that [type T] parameters provide.

Note that we still accept named arguments [A = T] in expressions; these are useful
for specifying some parameters and letting others be inferred.

Review by @smarter

Drop the [type T] syntax, and what's associated to make it work.

Motivation: It's an alternative way of doing things for which there seems
to be little need. The implementation was provisional and bitrotted during
the various iterations to introduce higher-kinded types. So in the end the
complxity-cost for language and compiler was not worth the added benefit
that [type T] parameters provide.

Noe that we still accept _named arguments_ [A = T] in expressions; these are useful
for specifying some parameters and letting others be inferred.
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.

LGTM, good simplification

val mod = atPos(in.skipToken()) { Mod.Type() }
(mods | Param | ParamAccessor).withAddedMod(mod)
} else {
if (mods.hasFlags) syntaxError(TypeParamsTypeExpected(mods, ident()))
Copy link
Member

Choose a reason for hiding this comment

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

The message TypeParamsTypeExpected is now unused and could be removed.

@smarter
Copy link
Member

smarter commented Mar 5, 2017

odersky added 2 commits March 5, 2017 11:16
(1) Drop unused error message
(2) Drop test which is now illegal
Deleting an error message changes all subsequent error message umbers,
which means that REPL tests were invalidated. This is a bit unfortunate
from a testing standpoint.
@odersky odersky merged commit 6131175 into scala:master Mar 5, 2017
@allanrenucci allanrenucci deleted the drop-named-param branch December 14, 2017 16:58
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