Generators with extended unions, null and undefined produces compiler errors #40044
Labels
Needs Investigation
This issue needs a team member to investigate its status.
Rescheduled
This issue was previously scheduled to an earlier milestone
Milestone
I've run into a weird problem in a project that uses async generators. I've reduced the problematic code to the example
below, which also fails in a similar way that my actual code does.
There seem to be several conditions that must be fulfilled:
T
is a union.T
(withWithID
in the example).null
andundefiened
.T
and eithernull
orundefined
(but not both).Change just any of these conditions in the playground, and the error goes away ...
TypeScript Version: 4.0.0-beta (and below)
Search Terms: generator null undefined
Expected behavior: No errors.
Actual behavior: A strange error message when
doSomething()
is called.Related Issues: No
Code
Output
Compiler Options
Playground Link: Provided
The text was updated successfully, but these errors were encountered: