# Bug Report <!-- Please fill in each section completely. Thank you! --> ### π Search Terms generator function union contextual typing yield ### π Version & Regression Information 4.1.5, 4.4.2 - This changed between versions **4.0.5** and **4.1.5** ### β― Playground Link [Playground link with relevant code](https://www.typescriptlang.org/play?target=99&ts=4.1.5#code/C4TwDgpgBAYgrgOwMYHkBOBxCCJoIbAD2a8yUAvFABQCUFAfNQnALYBGuUAPlFjvkTQAeKnjQBzAFxRm7XHXKMAboQCWAEwA0UPAhDaVG+jQBQZpIQQBnYFABm00qkzZcBYk4r3ESYKssAVLRQAN4mUFAA9JFQAKJoaMTSAApieCwQwJwA5LLZUKosYAA2qkiqwMUgUAAWeFY6CFDZuiD5oJAAdOFQIKoQxepMrAqMFtaExRCdxYTiVLI0ANwmAL5AA) ### π» Code ```ts type FuncOrGeneratorFunc = () => (number | Generator<(arg: number) => void, any, void>) const f: FuncOrGeneratorFunc = function*() { // Error: Parameter 'num' implicitly has an 'any' type. yield (num) => console.log(num); } ``` ### π Actual behavior A noImplicitAny error is reported. _Note: the same happens for async generator functions too._ ### π Expected behavior Type of `num` is inferred as `number`. This is the behavior of TS 4.0.