I have an interface
export interface ITypeAssertions
{
isOfTypeElseFail<TExpected extends TActual, TActual>(value: TActual, oxIsOfType: (xVal: TActual) => boolean): value is TExpected;
}
and implementation
export class NodeJsTestingFrameworkAdapter implements ITypeAssertions
{
isOfTypeElseFail<TExpected extends TActual, TActual>(value: TActual, oxIsOfType: (xVal: TActual) => boolean): value is TExpected
{
throw new Error("Method not implemented.");
}
}
Compiler complains that:
interface-not-properly-implemented
(...)
- Type predicate 'value is TActual' is not assignable to 'value is
TExpected'
- Type 'TActual' is not assignable to type 'TExpected'
- Type predicate 'value is TActual' is not assignable to 'value is
TExpected'
What's wrong? Is this a bug in a type-checker?
PS. It was compiling fine under Ts-2.3.
value is Ttoboolmakes it not a generic type-guard as the OP seems to want, is it ?