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

Move Id instances into implicit scope for Scala 3 #3906

Merged
merged 1 commit into from
May 30, 2021

Conversation

joroKr21
Copy link
Member

No description provided.

@joroKr21 joroKr21 marked this pull request as ready for review May 26, 2021 19:10
@djspiewak djspiewak merged commit 669790d into typelevel:main May 30, 2021
@joroKr21 joroKr21 deleted the id-instances branch May 31, 2021 06:52
@joroKr21
Copy link
Member Author

I think I missed Semigroupal

@armanbilge
Copy link
Member

Ah, I was having trouble with this as well.

@armanbilge
Copy link
Member

Btw, I think we also should consider putting Id's implicits in its companion object.

@joroKr21
Copy link
Member Author

It doesn't have a companion object - it's a type alias

@armanbilge
Copy link
Member

Ok, well whatever you call the object Id that sits next to the type alias :) I'm pretty sure anything there is in implicit scope in Scala 3, I recently did this in typelevel/feral@744013e#diff-de6a1bd431e8326aa1f0db9116e7f8d27c15a9c8a6bb6344aec9984873eead98

@smarter
Copy link
Contributor

smarter commented Nov 28, 2021

For abstract types, scala 3 will look for implicits in the same-named object, but not for type alias if I'm not mistaken.

@armanbilge
Copy link
Member

By abstract type, do you mean the difference between type INothing <: Nothing and type INothing = Nothing?

@smarter
Copy link
Contributor

smarter commented Nov 28, 2021

Yes.

@smarter
Copy link
Contributor

smarter commented Nov 28, 2021

Or well, types were the lower and upper bound actually differ, the INothing <: Nothing thing should in theory behave exactly like INothing = Nothing although the compiler implementation might not respect that

@armanbilge
Copy link
Member

Well, FTR I just changed INothing <: Nothing to INothing = Nothing in that code I linked and it continues to grab the implicit from the INothing companion object.

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.

5 participants