Lasse R.H. Nielsen

Results 772 comments of Lasse R.H. Nielsen

With full language support, there is no need to change APIs. Let's say we introduce a postfix operator, strawman syntax `catch`, which converts an expression of type `T` to an...

I don't see us changing existing APIs to return a `Result` rather than `T`+throwing. And I don't see us writing new APIs that way either, to be honest. Mainly because...

So if a switch has no *expression*, the patterns are all reduced to the when clause expressions (no value matches no pattern 100% of the time), or to a `_`...

Thinking about it more. _Maybe_ this should be an `if`, not a switch: ```dart if { a < b => -1, a == b => 0, else => 1, }...

This is about choosing the first of a list of possible cases whose boolean condition evaluates to true. That really is an `if`/`else` chain. Maybe if the formatter allowed a...

Don't need the `if` for that: ```dart action = isAvailableX() ? doAndReturnX() : isAvailableY() ? doAndReturnY() : isAvailableZ() ? doAndReturnZ() : null; ``` We already have the syntax for condition...

My worry here is that we may be chasing brevity, without actually achieving readability. The examples here show things that are *similar*. They have similar structures because they do similar...

The default-value syntax or `else` syntax are the most viable, the `??` one looks like it should act on `null`, not absence. Also makes sense for map patterns, as a...

@Zekfad that would not work. Extension types do not have interfaces or virtual methods. They cannot have an abstract method with no implementation. That's why this proposal would require the...

Classes already allow interfaces and virtual methods. Replace `extension type` with `class` in your example, and it works today. The value proposition for extension types is that they are *zero...