Closed
Description
Search terms
Union, duplicate declaration, intersection
Expected Behavior
Using function assertion to mark some properties as not optional if the function returns true but that cause typedoc to emit warning since version 0.25.3. Reverting to 0.25.2 solves the issue.
I wouldn't expect a warning to be emitted here.
Actual Behavior
Warning about duplicate declaration with different docs.
[warning] prop has multiple declarations with a comment. An arbitrary comment will be used.
[info] The comments for prop are declared at:
./src/index.ts:2
./src/index.ts:2
[info] The comments for prop are declared at:
./src/index.ts:2
./src/index.ts:2
./src/index.ts:2
./src/index.ts:2
error Command failed with exit code 3.
Steps to reproduce the bug
export interface TemplatedTypeBase {
/**
* Doc here
*/
prop?: string[];
}
export interface One extends TemplatedTypeBase {}
export interface Two extends TemplatedTypeBase {}
export type Type = One | Two;
// errors
export function isTemplateInstance(
type: Type
): type is Type & { prop: string[] } {
return true;
}
// also error
export function isTemplateInstance2(
type: Type
): type is Type & Required<TemplatedTypeBase> {
return true;
}
// this works
export function isTemplateInstance3(
type: Type
): type is Type & TemplatedTypeBase {
return true;
}
Repro PR: TypeStrong/typedoc-repros#35
Environment
- Typedoc version: 0.25.3
- TypeScript version: 5.2
- Node.js version: v18.17.1
- OS: osx
Metadata
Metadata
Assignees
Labels
No labels