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: work around FactoryConstructor failing with polymorphic @With annotation in one most common case #1943

Merged
merged 4 commits into from May 8, 2023

Conversation

neko-kai
Copy link
Member

@neko-kai neko-kai commented May 8, 2023

We're working around scala/scala3#16468 only in case where type variable is present both in With-annotation and on the annotated type:

trait XCarrier[T] {
  def x: Option[T] @With[Some[T]]
}

If the type variable is not present on the annotated type, we'll still fail as before:

trait XCarrier[T] {
  def x: Any @With[Some[T]] // can't figure out that T is XCarrier.T without the left-hand side mentioning T
}

 for cases where all type variables are present both on the annotated type and in `@With` annotation
@neko-kai neko-kai requested a review from pshirshov as a code owner May 8, 2023 22:49
@neko-kai neko-kai enabled auto-merge (squash) May 8, 2023 23:20
@codecov-commenter
Copy link

codecov-commenter commented May 8, 2023

Codecov Report

Merging #1943 (5b595fb) into develop (b18cb1c) will decrease coverage by 0.21%.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff             @@
##           develop    #1943      +/-   ##
===========================================
- Coverage    64.56%   64.36%   -0.21%     
===========================================
  Files          545      545              
  Lines        10939    10939              
===========================================
- Hits          7063     7041      -22     
- Misses        3876     3898      +22     

@neko-kai neko-kai merged commit bb927c2 into develop May 8, 2023
29 checks passed
@neko-kai neko-kai deleted the feature/scala3-factory-constructor-polymorphism branch May 8, 2023 23:40
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.

None yet

2 participants