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

Make :: type alias covariant #8642

Merged
merged 1 commit into from Jan 20, 2020
Merged

Make :: type alias covariant #8642

merged 1 commit into from Jan 20, 2020

Conversation

julien-truffaut
Copy link
Contributor

No description provided.

@scala-jenkins scala-jenkins added this to the 2.13.2 milestone Jan 17, 2020
@julien-truffaut
Copy link
Contributor Author

I just signed the CLA.

@diesalbla diesalbla added the library:collections PRs involving changes to the standard collection library label Jan 17, 2020
Copy link
Member

@lrytz lrytz left a comment

Choose a reason for hiding this comment

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

LGTM, I'm curious though if there's a way to observe the difference.

@lrytz lrytz merged commit 24594e0 into scala:2.13.x Jan 20, 2020
@julien-truffaut julien-truffaut deleted the patch-1 branch January 20, 2020 09:47
@julien-truffaut
Copy link
Contributor Author

@lrytz Yes, you can observe it.

class Foo[+A] {
  def nel: ::[A] = ???
}

fails with:

Error:(4, 7) covariant type A occurs in invariant position in type => ::[A] of method nel
  def nel: ::[A] = ???

but if you desalias it, it works fine:

 class Foo[+A] {
  def nel: scala.collection.immutable.::[A] = ???
}

@lrytz
Copy link
Member

lrytz commented Jan 20, 2020

@julien-truffaut thanks. Could you add this as a test case? For example here: https://github.com/scala/scala/blob/2.13.x/test/junit/scala/PredefTest.scala

@julien-truffaut
Copy link
Contributor Author

@lrytz Sure, should it be in scala/tree/2.13.x/test/files/pos ? What's the naming convention for the file?

@lrytz
Copy link
Member

lrytz commented Jan 20, 2020

test/files/pos is good. Thank you!

@lrytz
Copy link
Member

lrytz commented Jan 20, 2020

Oh, naming convention if we have no ticket, i'm not sure :-) Alternatively, add it to PredefTest.scala (which I liked above)

julien-truffaut added a commit to julien-truffaut/scala that referenced this pull request Jan 20, 2020
@julien-truffaut julien-truffaut mentioned this pull request Jan 20, 2020
@SethTisue
Copy link
Member

@julien-truffaut does #8651 have implications here?

@julien-truffaut
Copy link
Contributor Author

@SethTisue Sorry I don't know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
library:collections PRs involving changes to the standard collection library
Projects
None yet
7 participants