Skip to content

Commit 9768256

Browse files
Flow analysis: Fix promote()'s update of tested set. (#1116)
When promoting via a test on type T, the type that should be added to the test set is T, even if the actual promoted type is different. This brings the spec in line with the implementation.
1 parent 00b1276 commit 9768256

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

resources/type-system/flow-analysis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ Definitions:
443443
- Else if `S` is `X extends R` then let `T1` = `X & T`
444444
- Else If `S` is `X & R` then let `T1` = `X & T`
445445
- Else `x` is not promotable (shouldn't happen since we checked above)
446-
- Let `VM2 = VariableModel(declared, T1::promoted, T1::tested, assigned,
446+
- Let `VM2 = VariableModel(declared, T1::promoted, T::tested, assigned,
447447
unassigned, captured)`
448448
- Let `M2 = FlowModel(r, VI[x -> VM2])`
449449
- If `T1 <: Never` then `M3` = `unreachable(M2)`, otherwise `M3` = `M2`

0 commit comments

Comments
 (0)