hendursaga has quit [Remote host closed the connection]
hendursaga has joined #crystal-lang
DTZUZU has joined #crystal-lang
DTZUZU_ has quit [Ping timeout: 268 seconds]
astronavt has quit [Remote host closed the connection]
<FromGitter>
<erdnaxeli:cervoi.se> what is the best way to know if a type is `Int32?` ? (in a macro)
<FromGitter>
<erdnaxeli:cervoi.se> I see there is `nilable?`
<FromGitter>
<erdnaxeli:cervoi.se> or `union_types`, but that returns an array so it is ordered
<FromGitter>
<Blacksmoke16> `.nilable?` would be the way to go
<FromGitter>
<zomatree0:matrix.org> when inside a class function and i do ` if !@myattr.nil?` the compiler doesnt see this and throws an error because it could be `Nil`, is this an bug or something to do with race conditions? (note if i do `myvar = @myattr` then use it it works fine)
<FromGitter>
<erdnaxeli:cervoi.se> @Blacksmoke16: but I want to know if it is exactly `Int32?`, not `Something?`
<FromGitter>
<erdnaxeli:cervoi.se> so far I got `{% if ivar.type.union_types.size == 2 && ivar.type.union_types.includes?(String) && ivar.type.nilable? %}`
<FromGitter>
<Blacksmoke16> did you try like `ivar.type == Int32?`?
<FromGitter>
<erdnaxeli:cervoi.se> no, it works x)
<FromGitter>
<erdnaxeli:cervoi.se> thanks
DTZUZU_ has joined #crystal-lang
DTZUZU has quit [Ping timeout: 246 seconds]
zaltekk has quit [Quit: leaving]
ua has quit [Ping timeout: 240 seconds]
ua has joined #crystal-lang
_ht has quit [Remote host closed the connection]
sorcus has quit [Ping timeout: 258 seconds]
richbridger has joined #crystal-lang
<FromGitter>
<zomatree0:matrix.org> is there a way to use websockets while using fibers?, it seems the websocket is blocking the fibers
<straight-shoota>
yes, that should definitely work
<FromGitter>
<zomatree0:matrix.org> how? i can only find the .run method that seems to block everything
<straight-shoota>
Yes. When you call that method in a fiber, all other fibers still run.
<straight-shoota>
You just can't add code after that call.