type Test = [T] extends [any[]] ? { array: Test } : { notArray: T }; declare const x: Test; const y: { array: { notArray: number } } = x; // Error declare const a: Test; const b: { notArray: number } = a; // Works