Feeling pretty stupid here, but I'm not sure what the wildcard is doing in, say, -1 : Num *
is. -1
is just a Num
, as far as I can tell, it doesn't contain an associated unknown type, and I'm not sure what an 'open' Num
would even mean....
I'm on mobile, so a quick explanation is that a number literal can be used as any number type, if you have a function that takes an I8 then you can pass -1 to it, and you can use the same -1 in a function that takes an F64
Yeah, exactly that, so Num (Integer Signed8)
vs Num (FloatingPoint Binary64)
Last updated: Jul 06 2025 at 12:14 UTC