---
source: crates/oxc_isolated_declarations/tests/mod.rs
input_file: crates/oxc_isolated_declarations/tests/fixtures/generator.ts
---
==================== .D.TS ====================

declare function generatorGood(): Generator<number>;
declare class GeneratorClassGood {
	method(): Generator<number>;
}
declare function generatorBad();
declare class GeneratorClassBad {
	method();
}


==================== Errors ====================

  x TS9007: Function must have an explicit return type annotation with
  | --isolatedDeclarations.
    ,-[15:11]
 14 | // Incorrect
 15 | function *generatorBad() {
    :           ^^^^^^^^^^^^
 16 |   yield 50;
    `----

  x TS9008: Method must have an explicit return type annotation with
  | --isolatedDeclarations.
    ,-[21:4]
 20 | class GeneratorClassBad {
 21 |   *method() {
    :    ^^^^^^
 22 |     yield 50;
    `----
