Lasse R.H. Nielsen

Results 772 comments of Lasse R.H. Nielsen

You do not get promotion from `identical` checks in Dart. That includes those done by switch cases. So, the type of `this` doesn't change just because it happens to be...

It perhaps shouldn't be necessary. Good point. That's a language issue, implementations are acting as currently specified. Moving this to the language repo. We used to require that the type...

That's a good way to put it: In a switch case expression, we want to ensure that the expression (constant) value *can be* the same as the switch expression value....

Everything here assumes a *string*. If the example had been ```dart int? age; var str = "Age: $age"; // vs var str2 = "Age: " + age.toString(); // toString call...

I've suggested `record[0]` before (can't find where). It works, and the main issue is that it looks like the index operator, but is actually a special record syntax which requires...

All the suggested syntaxes work as selectors, so they can be used with null-aware access (`r?.0`, `r?[0]`, `r?.$0`) and cascades (`r..0.action()..1.action()`, etc.). That's good. The `.0` can have a parsing...

True, and if we then extend `.0` member access to classes, say as `operator 0 () => ...`, then It'll probably be only seconds before we see things like: ```dart...

No complaints, go with `$0` etc. We could, if we wanted to, defined `$0` as a magical extension method. We could do that for named fields too. That is, we...

That is what I'd intend. Using `dynamic` never gives you a static failure. ``` dynamic d = ...; (int x, String y) = (d, d); ``` should be completely equivalent...

A static type requirement is always satisfied by an expression of type `dynamic`, but it's satisfied by that expression being implicitly downcast to the required type. That happens in the...