I have a bug but I don’t know if it’s already in y...
# javascript
g
I have a bug but I don’t know if it’s already in youtrack:
Copy code
fun main(args: Array<String>) {
    
    var one = '1'
    one shouldEqual '1'
    
    val foo = Foo('2')
    foo.bar shouldEqual '2'  //<- should not complain, but it does.
}

class Foo(val bar:Char = ' ')
    
infix fun <T> T.shouldEqual(any: Any?): Unit {
    if (this != any)
        println("$this did not equal $any")            
}
To try it online: https://try.kotlinlang.org/#/UserProjects/vt8l2cck3f0fak5t0ks4grpqlr/ai0kcea10ier1sgnj02g0eqiop
k