Johan Nordlander

Results 56 comments of Johan Nordlander

@plajjan See my comment in #2380

I suppose the question is really whether we can dynamically check if expression `foo` is an instance of `dict[str,...]`. If so the answer is no, not in the desired amount...

Yes, this feature is on the to-do list. But type narrowing will be tied to the _syntax_ of the expressions matched, so the following won't work: ``` if isinstance(foo["hello"], str):...

Exactly, expression matching will be done on the abstract syntax.

The obstacle here is that `:=` means variable (re)assignment in pretty much every language that uses the operator. Introducing the opposite reading in Acton looks like it could lead to...

Could not agree more! But the exhaustive idea must also be coupled to some ability to close a class's extension hierarchy. Say that we have a class `MyType` with two...

But it does! You're just missing a `return` in front of of the `bar()` call. Without a return in both if-branches you actually have a function that can fall through,...

Ah, so you're saying that `bar` should really have been given a fully generic return type, since it can never return anything? Interesting, let me think about that...!

So this really boils down to whether we want to keep the concept of "falling through a statement" a purely syntactic matter, or whether we want it to also include...

@plajjan I think `%` for strings should be hidden away. Our current support is really ad hoc, considering that our grammar actually sees `%` as a generic binary operator that...