ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
greenbigfrog has quit [Ping timeout: 264 seconds]
greenbigfrog has joined #crystal-lang
deavmi has quit [Ping timeout: 252 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
_whitelogger has joined #crystal-lang
fifr has joined #crystal-lang
arestifo has joined #crystal-lang
<hightower2> ++
<hightower2> Reviewing https://github.com/crystal-lang/crystal/issues/10277 again... I just had a case where I was comparing types that will never match (if x == y), taking me a while to find the bug. Given that 1.0 has been released, clearly changing the behavior of == won't happen. And although I'd very much prefer to do the investigation into in how many places exactly == is used to validly compare non-matching types, I don't see when at
<hightower2> all I could attempt this.
<hightower2> I don't particularly like the idea in the ticket to use #eql?, because my code would basically use #eql? in all places, #eql? would be used much more often than #==, but it's inconvenient to write (both itself being an abbreviation, plus requiring shift in english keyboards to type the '?')
<hightower2> I am probably going to do a quick code that can be hooked in via reopening classes, which modifies those default implementations of ==, to report the types being compared to STDERR. So I can run it a couple times to review the program, then disable it.
<hightower2> That's a method I used previously and it was effective... Most of the time I found invalid comparisons between Char and Strings
<straight-shoota> I suppose maybe a linter could do such type validations
arestifo has quit [Ping timeout: 245 seconds]
arestifo has joined #crystal-lang
<hightower2> That's a good idea... I think back then someone was saying on IRC that it had no place in linter, but I don't see why not... especially since it does the checks at final app level, so it can check user's own code, while not dealing with anything from built-in crystal
<hightower2> I might create an issue in ameba just to test the waters
rem has joined #crystal-lang
arestifo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jhass[m]> Huh, we totally should allow comparing String and Char
<jhass[m]> `'a' == "a"` and `"a" == 'a'"` should be true IMO
<straight-shoota> I don't think so
greenbigfrog has quit [Remote host closed the connection]
arestifo has joined #crystal-lang
<hightower2> well yes this was just an example, I was thinking completely in general
<hightower2> like, comparing wrong/unintended types by mistake, like if 13 == GC ... this won't fail or appear as issue anywhere, it will just always be false
<arestifo> And it wouldn't be possible to have compiler warning for such cases?
<hightower2> I think not because this was intentionally made possible, for multiple reasons, but most obviously to allow things like `if [ 1, 2, "test", Something ].includes? some_value`
<hightower2> (If you joined later in the discussion, see https://github.com/crystal-lang/crystal/issues/10277)
<hightower2> Suggestion from straight-shoota was to try get detection for this in the linter... which I'm gonna open an issue on, later today
<arestifo> Interesting problem
<straight-shoota> yes, when testing if two values are equal there are a number of different semantics that could be reasonably expected
hightower2 has quit [Ping timeout: 252 seconds]
hightower2 has joined #crystal-lang
<jhass> alright, our project registration here is through now, if anybody wants a crystal/user cloak gladly ping me
<hightower2> ++
arestifo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arestifo has joined #crystal-lang
avane has quit [Ping timeout: 272 seconds]
avane has joined #crystal-lang
rem has quit [Ping timeout: 272 seconds]
arestifo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arestifo has joined #crystal-lang
arestifo has quit [Client Quit]
arestifo has joined #crystal-lang
arestifo has quit [Client Quit]
hightower2 has quit [Ping timeout: 245 seconds]
deavmi has quit [Read error: Connection reset by peer]
deavmi has joined #crystal-lang
deavmi has quit [Read error: Connection reset by peer]
deavmi has joined #crystal-lang
Epsilon has joined #crystal-lang
rem has joined #crystal-lang
Epsilon has quit [Remote host closed the connection]
Epsilon has joined #crystal-lang
hightower2 has joined #crystal-lang
deavmi has quit [Read error: Connection reset by peer]
deavmi has joined #crystal-lang
Epsilon has left #crystal-lang [#crystal-lang]
Epsilon has joined #crystal-lang
Epsilon has left #crystal-lang [#crystal-lang]
rem has quit [Quit: Connection closed]