Skip to content

Fix #7868: Normalize type parameter in ValueOf #7905

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 1 commit into from
Jan 7, 2020

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki nicolasstucki marked this pull request as ready for review January 6, 2020 17:25

def upCast[A, B](a: A)(given erased evidence: (A <:< B)): B = a.asInstanceOf[B]

def from[Set, Value, Index <: Int](value: Value)(given erased at: At[Set, Value, Index]): (given ValueOf[Index]) => Coproduct[Set, Value, Index] = {
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 had to change the test case slightly to make sure Index was fully defined before looking for ValueOf[Index].

@nicolasstucki nicolasstucki requested a review from odersky January 6, 2020 17:29
@@ -861,7 +861,7 @@ trait Implicits { self: Typer =>

formal.argTypes match {
case arg :: Nil =>
fullyDefinedType(arg.dealias, "ValueOf argument", span) match {
fullyDefinedType(arg.dealias, "ValueOf argument", span).normalized match {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if it should be instead

fullyDefinedType(arg.dealias.normalized, "ValueOf argument", span)
// or
fullyDefinedType(arg.normalized.dealias, "ValueOf argument", span)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's most general this way.

@@ -861,7 +861,7 @@ trait Implicits { self: Typer =>

formal.argTypes match {
case arg :: Nil =>
fullyDefinedType(arg.dealias, "ValueOf argument", span) match {
fullyDefinedType(arg.dealias, "ValueOf argument", span).normalized match {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's most general this way.

@odersky odersky merged commit 0254b1b into scala:master Jan 7, 2020
@odersky odersky deleted the fix-#7868 branch January 7, 2020 12:20
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