Skip to content

Compiler error on valid scala code when using implicit parameters + default parmeters #8998

Open
@rcano

Description

@rcano

Minimized code

  import scala.compiletime.ops.int._
  def test(i: Int = 3)(using i.type > 0 =:= true) = i
  //test(3) compiles
  //test(-2) proper compiler error
  test()

Output

 2 |  test()
   |        ^
   |        Cannot prove that (?1 : Int) > (0 : Int)
   |
   |        where:    ?1 is an unknown value of type Int
   |         =:= (true : Boolean).
one error found

Expectation

code should compile as is the case when manually passing the value

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions