diff --git a/src/Complex/type.ts b/src/Complex/type.ts index d0845c8..50a231f 100644 --- a/src/Complex/type.ts +++ b/src/Complex/type.ts @@ -7,7 +7,7 @@ export type Complex = { re: T; im: T; } export const Complex_type = { test: (dep: { testT: (z: unknown) => z is T }) => (z: unknown): z is Complex => - typeof z === 'object' && 're' in z && 'im' in z + typeof z === 'object' && z != null && 're' in z && 'im' in z && dep.testT(z.re) && dep.testT(z.im), infer: (dep: typeOfDependency) => (z: Complex) => joinTypes(dep.typeOf(z.re), dep.typeOf(z.im)),