3 ms·
>That's what makes a static type system different from type assertions or guards. This system is different from type assertions or guards in that you do not hav
by discreteevent 13y ago
>That's what makes a static type system different from type assertions or guards.
This system is different from type assertions or guards in that you do not have to write any assertions but will still be informed of most type errors at compile time and virtually all type errors at runtime (Its been a while since I have written some Dart so I'm not 100% sure and don't have time to check if its exactly 100% of scenarios)
> This means that if you cover your code at all, manually or automatically then it will inform you of type errors.
>> This is always true in any dynamic language.
No, there's a difference. I will get the error in dart as soon as I try to use the object in any way. In a dynamic language I could call a few methods on it before calling a method it does not support. i.e. it behaves like a compiler would except at run-time. This makes a big difference in how quickly you can debug it and again this is only for the minority of scenarios that are not covered at compile time.