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

Scala 3: fix failures to combine higher-kinded type lambdas where type parameters of a higher-kinded type parameter were not extracted correctly #365

Merged
merged 1 commit into from
Jan 20, 2023

Conversation

neko-kai
Copy link
Member

No description provided.

…e parameters of a higher-kinded type parameter were not extracted correctly
@neko-kai neko-kai enabled auto-merge (squash) January 20, 2023 21:05
@neko-kai neko-kai merged commit 6bd21b8 into develop Jan 20, 2023
@neko-kai neko-kai deleted the feature/params-of-hkt-type-param-extraction-fix branch January 20, 2023 21:17
// No, It's not a reliable substitution. When used on a TypeParamRef it returns Any instead of the underlying TypeBounds
// https://github.com/lampepfl/dotty/issues/15799

val underlying = typeRef

Choose a reason for hiding this comment

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

@neko-kai Another way to experiment using the compiler internals could be

import scala.reflect.Selectable.reflectiveSelectable
type Context
type InternalQuotes = {
  def ctx: Context
}
type InternalTypeRef = {
  def underlying(using Context): TypeRepr
}
given Context = qctx.asInstanceOf[InternalQuotes].ctx
typeRef.asInstanceOf[InternalTypeRef].underlying

Copy link
Member Author

Choose a reason for hiding this comment

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

@nicolasstucki I'll keep this in mind. Thanks! 👍

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