pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Philpax has quit [Ping timeout: 252 seconds]
Philpax has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
trapped has joined #crystal-lang
ome has quit [Quit: Connection closed for inactivity]
ome has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
elia has joined #crystal-lang
Philpax_ has joined #crystal-lang
Philpax has quit [Ping timeout: 252 seconds]
bjz has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Client Quit]
Oliphaunte has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Oliphaunte has quit [Ping timeout: 250 seconds]
bjz has joined #crystal-lang
mbarbar has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
pawnbox has quit [Remote host closed the connection]
g3funk is now known as braidn
pawnbox has joined #crystal-lang
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 240 seconds]
<alsm>
can types be values? I'm writing an mqtt client, when I receive a packet the first byte tells me what kind of control packet we're receiving, I need to use that information to create a new <packet_type> and call that types from_io, so essentially want a lookup table of UInt8 to <packet_type>
pawnbox has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
<alsm>
doing a case on the type UInt8 instead
pawnbox has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
<alsm>
hmm, can't have from_io on an abstract class to do io.read_bytes ?
ozra has joined #crystal-lang
snsei has joined #crystal-lang
Oliphaunte has joined #crystal-lang
ozra has quit [Ping timeout: 258 seconds]
paulcsmith_ has joined #crystal-lang
snsei has quit [Remote host closed the connection]
paulcsmith_ has quit [Client Quit]
paulcsmith_ has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
paulcsmith_ has joined #crystal-lang
snsei has joined #crystal-lang
Philpax_ has quit [Ping timeout: 252 seconds]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
paulcsmith_ has joined #crystal-lang
Raimondii is now known as Raimondi
mbarbar has quit [Ping timeout: 276 seconds]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
mark_66 has quit [Quit: Leaving.]
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ozra has joined #crystal-lang
alsm has quit [Ping timeout: 264 seconds]
<RX14>
crystal's stdlib specs are taking ages and ages on my machine.
<RX14>
downgrading something which isnt nillable to something which is nillable should be easy
<RX14>
yet i can't seem to do it
<RX14>
i have a class where one of the class variables is Hash(String, String?)?
<RX14>
and i need to pass a Hash(String, String) to the constructor
<RX14>
but I can't work out how to deal with it
<RX14>
because to me, they are compatible types
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<BlaXpirit>
RX14, well no, they're not compatible types and conversion is a costly process. if you think about it, a type could even define an entirely special behavior depending on the subtype
<RX14>
well... it worked on older crystal
<RX14>
just worked
<RX14>
no special code just magically converted
<BlaXpirit>
RX14, really doubt it
<RX14>
yeah sorry it did
<BlaXpirit>
RX14, no it didn't
<RX14>
well whatever i did worked
elia_ has joined #crystal-lang
<RX14>
and the type signature was definitely Hash(String, String?)?
<BlaXpirit>
>> a = {"a" => "b"}.map { |k, v| {k, v as String?} } .to_h; pp a
<RX14>
it's totally fine with hash(String, String) being a subset of Hash(String, String?)? when used as a type restruction but it can't handle it as an instance var, i guess it must codegen different methods based on the type
<BlaXpirit>
RX14, yes, hmm that must be something new, and quite nice to allow this flexibility when used as a type restriction
<BlaXpirit>
but an instance variable must have a predefined memory layout
<RX14>
its just weird
<RX14>
so weird
<RX14>
it's not the error I woulkd expect in this situation at all
<RX14>
i would expect that I don't have to rewrite my spec file to specify the type sygnature of every hash when I didn't before...
<RX14>
it's a regression, i don't know how it worked before but it did