Skip to content

Cant use compiletime.ops.any.== with String when type of a value #8392

Closed
@bishabosha

Description

@bishabosha

minimized code

scala> import compiletime.ops.any._

scala> summon["" == "" =:= true]                                                                                        
val res1: true =:= true = generalized constraint

scala> val t: "" == "" = true
1 |val t: "" == "" = true
  |       ^
  |       Type argument ("" : String) does not conform to upper bound AnyVal 
1 |val t: "" == "" = true
  |             ^
  |       Type argument ("" : String) does not conform to upper bound AnyVal 

expectation

EDIT: the second example behaves according to its definition of type ==[X <: AnyVal, Y <: AnyVal] <: Boolean. However it should behave like the first. The type signature should be changed so that t can be typed

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions