Discovered while auditing repeated builtin Function construction for #457 (performance tracker #416). With strict/noLib/noEmit and the usual minimal global declarations plus interface Function { call(thisArg: any, ...args: any[]): any; }, both TS 6.0.3 and native TS 7.0.2 accept the following, while Home at 6a78f4e rejects the call and assignment with TS2349/TS2322:
function isCallable(value: unknown): value is Function {
return typeof value === "function";
}
declare const value: number | (() => number);
if (isCallable(value)) {
const result: number = value();
const exact: () => number = value;
} else {
const result: number = value;
}A predicate targeting an alias of Function reproduces the call error too. An important control: replacing the global Function declaration with an empty interface makes TS 6 and TS 7 retain the union and correctly reject the positive-branch call. Preserve that declared-shape distinction; do not merely treat every name spelled Function as callable.
Relevant implementation: predicateTargetIsFunctionObject constructs a fresh builtin Function object then compares TypeIds, but internObjectType deliberately bypasses deduplication. Whole-object memoization would therefore change predicate behavior. The performance work will preserve fresh outer identities and reuse internal immutable construction components; this issue tracks the semantic correction independently.
Acceptance: cover direct and aliased predicates, positive/negative branches, empty versus callable global Function shapes, and negative typed-consumption controls against both pinned TS versions; run checker/conformance gates and avoid spelling-only or benchmark-specific shortcuts.