microsoft / microsoft/TypeScript
Strange 2488 error involving overload resolution and this parameter type
Abierto
@rbuckton ya está trabajando en esto.
Desde el 31/10/2024.
Needs Investigation
- Lenguaje dominante
- Go
- Estrellas
- 111k
- Forks
- 14.4k
- Merge medio
- 1 d 19 h
- PR fusionados (30 d)
- 117
Descripción
🔎 Search Terms
yield ts2488 never iterator
🕗 Version & Regression Information
- This changed between versions 3.5.1 and 3.6.2
every-ts bisect gives: e8bf9584aa74aabfecb51a02edb13e3657508274 is the first bad commit
⏯ Playground Link
💻 Code
declare function fn<T>(value: () => T): { (): T };
declare function fn<T>(value: T): Iterable<unknown>;
export class A {
a = fn(function* (this: A) {
yield* fn(1); // error
});
b = fn(function* (this: A) {
const temp = fn(1); // ok
yield* temp;
});
}
🙁 Actual behavior
src/error.ts:6:16 - error TS2488: Type 'never' must have a '[Symbol.iterator]()' method that returns an iterator.
6 yield* fn(1);
~~~~~
🙂 Expected behavior
No error, as in A.b
Additional information about the issue
No response
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Evaluación
Este issue todavía no se ha evaluado.