-
Notifications
You must be signed in to change notification settings - Fork 205
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
1 parent
782ac82
commit 2fa0e6d
Showing
3 changed files
with
19 additions
and
4 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
import { BaseType } from "./BaseType.js"; | ||
|
||
export class UnknownType extends BaseType { | ||
constructor() { | ||
constructor( | ||
/** | ||
* If the source for this UnknownType was from a failed operation than to an actual `unknown` type present in the source code. | ||
*/ | ||
readonly erroredSource = false, | ||
) { | ||
super(); | ||
} | ||
|
||
public getId(): string { | ||
return "unknown"; | ||
} | ||
} | ||
|
||
/** | ||
* Checks for an UnknownType with an errored source. | ||
*/ | ||
export function isErroredUnknownType(type: BaseType): type is UnknownType { | ||
return type instanceof UnknownType && type.erroredSource; | ||
} |