-
Notifications
You must be signed in to change notification settings - Fork 27
'is' check in a trinary operator should do type promotion #327
Comments
@kevmoo Can you recheck this? I'm not seeing any problems as of:
|
Here's the concrete error I'm getting
For https://github.com/bp74/StageXL at bp74/StageXL@37a4ec9
> dartanalyzer --version
dartanalyzer version 1.13.0-dev.5.0 |
@kevmoo type promotion won't happen here, as spec'd in Dart Language. What is going on: we know I'll add this case to #274, but in the short-to-medium term I don't think we can do anything about this case. In general, type promotion as currently specified is fairly broken, but it's not clear that it can be fixed. I think we need new syntax like Pattern Matching. |
|
Eh, strike my suggestion above, that would break assigning the "promoted" variable to a variable of type |
folding this into #274 |
(specifically, this is an example of the existing case "if the tested type S is not a subtype of T, the test won't promote. You'd have to track a union type.") |
...er, whenever it's called.
The text was updated successfully, but these errors were encountered: