Skip to content

Unexpected typer error with Scala 3.3.7 #24165

@plokhotnyuk

Description

@plokhotnyuk

Compiler version

3.3.7

Minimized code

No minimization yet, only steps to reproduce so far:

  1. Clone reproducing sbt project:
git clone --depth 1 https://github.com/plokhotnyuk/jsoniter-scala
  1. Switch to the affected branch:
git checkout scala-3.3.7
  1. Run the following sbt command:
sbt ++3.3.7 jsoniter-scala-macrosJVM/test

Output

The following compilation error in the typer for the macro generated code:

[error]     |               |
[error]     |               |Error:
[error]     |               |assertion failed: Type Mismatch (while checking adapt):
[error]     |Found:    (com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight.Green :
[error]     |  com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight) |
[error]     |  (com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight.Green :
[error]     |    com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight)
[error]     |Required: (com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight.Green :
[error]     |  com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight)
[error]     |I tried to show that
[error]     |  (com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight.Green :
[error]     |  com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight) |
[error]     |  (com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight.Green :
[error]     |    com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight)
[error]     |conforms to
[error]     |  (com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight.Green :
[error]     |  com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight)
[error]     |but none of the attempts shown below succeeded:
[error]     |
[error]     |  ==> (com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight.Green :   com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight) |   (com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight.Green :     com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight)  <:  (com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight.Green :   com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight)
[error]     |  <== (com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight.Green :   com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight) |   (com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight.Green :     com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight)  <:  (com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight.Green :   com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight) = false
[error]     |
[error]     |The tests were made under the empty constraint
[error]     |tree = if in.isNextToken(123) then
[error]     |  {
[error]     |    in.rollbackToken()
[error]     |    in.skip()
[error]     |    com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight.Green
[error]     |  }
[error]     | else 
[error]     |  in.readNullOrTokenError[
[error]     |    
[error]     |      (com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight.Green :
[error]     |        com.github.plokhotnyuk.jsoniter_scala.macros.TrafficLight)
[error]     |    
[error]     |  ](default, 123)

Expectation

No compilation errors

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions