Re:TypeScript’s quirks: How inconsistencies make the languag...
by potatoz2 on Friday January 31, 2020 @10:06PM
(#22208357)
I don't follow how knowing C and Assembler makes types clear and I'd love it if you could clarify.
Nominal types are really a compile time only thing: if you have two structs (or classes) with the exact same fields, I'd expect them to be stored the same way in memory. And as a result I'd expect any function to work on them just fine, as long as they find semantically valid data at the right offsets.
Nominal types are really a compile time only thing: if you have two structs (or classes) with the exact same fields, I'd expect them to be stored the same way in memory. And as a result I'd expect any function to work on them just fine, as long as they find semantically valid data at the right offsets.