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

Fix partially #30 (only Scala 3) #278

Merged
merged 1 commit into from
May 30, 2022
Merged

Conversation

y-yu
Copy link
Contributor

@y-yu y-yu commented Mar 27, 2022

@CLAassistant
Copy link

CLAassistant commented Mar 27, 2022

CLA assistant check
All committers have signed the CLA.

@neko-kai
Copy link
Member

@y-yu
Wow, thank you! 🙏

@neko-kai
Copy link
Member

For Scala 2 fix, I think most of the issue is contained in mkHKTagArgStruct function in TagMacro.scala - as far as I remember all we have to do is generate bounds for the parameters there, e.g. add ability to generate types like HKTag[{ type Arg[T <: Int] = K[T] }] in addition to HKTag[{ type Arg[T] = K[T] }] types that we generate right now.

/**
* Returns true if the given type contains no type parameters
* (this means the type is not "weak" https://stackoverflow.com/questions/29435985/weaktypetag-v-typetag)
*/
private def allPartsStrong(typeRepr: TypeRepr): Boolean =
typeRepr.dealias match {
case x if x.typeSymbol.isTypeParam => false
case x if x.typeSymbol.isTypeParam && summonable(x) => false
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way to avoid implicit search here? In what situation do we need to regard a type parameter as strong if it doesn't have an implicit Tag?

Copy link
Contributor Author

@y-yu y-yu Apr 9, 2022

Choose a reason for hiding this comment

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

I was trying to fix this and finally it had worked without implicit search 🎉 after merging #279. (But I don't understand why it worked... 😇 )

@y-yu y-yu requested a review from neko-kai April 13, 2022 18:10
@neko-kai neko-kai merged commit ff7fe84 into zio:develop May 30, 2022
@neko-kai
Copy link
Member

@y-yu Thank you! 🙏

@y-yu y-yu deleted the fix-issue-30-scala3 branch June 8, 2022 16:39
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.

3 participants