|
|
|
|
|
by janderland
842 days ago
|
|
Check it once and type cast it before passing it down the call stack. If you need a polymorphic type all the way down then model it using structs and interfaces so that the required operations are always available as methods.
It’s the same as other languages which lack optionals/narrowing: C/C++, Java, etc. |
|
Say i have `*Thing`. Are you saying i should cast it to a `Thing`? That is what I was doing initially (im fine with copies), but then you can't call functions that mutate.