-
Notifications
You must be signed in to change notification settings - Fork 199
Open
Description
When I try to intersect a type extended from base and then evaluate it, it turns into never
import { Type, type StaticDecode } from 'typebox';
class TId extends Type.Base<string> {}
const schemaNonEvaluated = Type.Intersect([
new TId(),
new TId(),
]);
type TNonEvaluated = StaticDecode<typeof schemaNonEvaluated>;
/**
* const schemaNonEvaluated: Type.TIntersect<[TId, TId]>;
* type TNonEvaluated = string;
*/
const schemaEvaluated = Type.Evaluate(schemaNonEvaluated);
type TEvaluated = StaticDecode<typeof schemaEvaluated>;
/**
* const schemaEvaluated: Type.TNever;
* type TEvaluated = never;
*
* instead of
*
* const schemaEvaluated: TId;
* type TEvaluated = string;
*/Reactions are currently unavailable