Skip to content

Regression in disneystreaming/smithy-translate for inferred wildcard Java types #20078

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

Closed
WojciechMazur opened this issue Apr 3, 2024 · 0 comments · Fixed by #20116
Closed
Assignees
Labels
area:typer compat:java itype:bug regression This worked in a previous version but doesn't anymore
Milestone

Comments

@WojciechMazur
Copy link
Contributor

Based on Open CB failure in disneystreaming/smithy-translate - builds logs

Compiler version

3.5.0-RC1-nightly

Last good release: 3.4.2-RC1-bin-20240324-a6c40b1-NIGHTLY
First bad release: 3.5.0-RC1-bin-20240326-43ed9fd-NIGHTLY

Bisect points to 0f30c98

Minimized code

@main def Test = 
  val builder: AbstractShapeBuilder[? <: AbstractShapeBuilder[?, ?], ? <: Shape] = ???
  List.empty[Trait].foreach(builder.addTrait(_))
public abstract class AbstractShapeBuilder<B extends AbstractShapeBuilder<B, S>, S extends Shape> {
	abstract public B addTrait(Trait trait);
}
public interface Shape {}
public interface Trait {}

Output

-- [E057] Type Mismatch Error: /Users/wmazur/projects/scala3/bisect/main.scala:3:35 
3 |  List.empty[Trait].foreach(builder.addTrait(_))
  |                                   ^
  |Type argument ?1.CAP does not conform to upper bound AbstractShapeBuilder[?1.CAP, ?2.CAP] in inferred type AbstractShapeBuilder[?1.CAP, ?2.CAP]
  |
  |where:    ?1 is an unknown value of type scala.runtime.TypeBox[Nothing,
  |  AbstractShapeBuilder[AbstractShapeBuilder[?, ?], ? <: Shape]]
  |          ?2 is an unknown value of type scala.runtime.TypeBox[Nothing, Shape]
  |
  | longer explanation available when compiling with `-explain`

Expectation

Should compile

@WojciechMazur WojciechMazur added itype:bug area:typer compat:java regression This worked in a previous version but doesn't anymore labels Apr 3, 2024
@odersky odersky self-assigned this Apr 3, 2024
smarter added a commit that referenced this issue Apr 8, 2024
Don't dealias when deciding which arguments to defer for subtype
checking

Fixes #20078
@Kordyjan Kordyjan added this to the 3.5.0 milestone May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:typer compat:java itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants