#Checking whether types can coerce to each other

1 messages · Page 1 of 1 (latest)

slate rivet
#

I have types TA and TB. Can I check if TB can coerce to TA? If yes, how?

ember mirage
slate rivet
tender void
#

the simple answer is to just do it

slate rivet
tender void
#

exactly

slate rivet
#

and I want to check programatically

#

so that's out of the question

tender void
#

then you'll need to use @typeInfo and compare all of the possible incompatibilities; there isn't anything for this in the stdlib

slate rivet
#

yikes

#

thanks

honest temple
#

@TypeOf(a, b) returns the peer-resolved type of a and b. It would be nice if it returned an optional when given more than one argument

thick herald
#

I think that'd be best as a separate built-in which takes the actual types, e.g. @TypeResolve(T1, T2).?

slate rivet
sterile vortex
sterile vortex