-
-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
45 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/knip/fixtures/class-members/iterator-generator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export abstract class AbstractClassGen { | ||
protected constructor() {} | ||
|
||
public abstract implemented(): AbstractClassGen; | ||
|
||
public abstract unimplemented(): AbstractClassGen; | ||
|
||
public abstract [Symbol.iterator](): Iterator<AbstractClassGen>; | ||
} | ||
|
||
export class ExtendedClassGen extends AbstractClassGen { | ||
public constructor() { | ||
super(); | ||
} | ||
|
||
public implemented(): AbstractClassGen { | ||
return this; | ||
} | ||
|
||
public *[Symbol.iterator](): Iterator<AbstractClassGen> { | ||
yield this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export abstract class AbstractClass { | ||
public abstract implemented(): AbstractClass; | ||
public abstract [Symbol.toStringTag](): AbstractClass; | ||
} | ||
|
||
export class ExtendedClass extends AbstractClass { | ||
public implemented(): AbstractClass { | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters