Raoul Duke
unread,Feb 6, 2026, 11:11:00 PMFeb 6Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pi...@googlegroups.com
even with all sorts of flags on, it feels like there are lots of times
when "ze type zyztem - eet duz nuzzing!!!"
i am not saying it was ever advertised otherwise, but it still is
sad-face at times for me.
here is what Gemini says
TypeScript's strictest mode, even with all flags enabled, is still
considered structurally typed and not completely sound. Several
aspects remain unchecked or un-catchable by the compiler, including:
Null and Undefined Assertion Operators: The non-null assertion
operator ! and definite assignment assertions (declare property or
using !: in constructor) force the compiler to trust the developer
that a value isn't null or undefined, bypassing strict null checks
(strictNullChecks).
Type Assertions (as): The as keyword allows a developer to assert a
type onto an expression, effectively telling the compiler to ignore
potential type incompatibilities.
Structural Typing (vs. Nominal Typing): TypeScript uses structural
typing, meaning a type is compatible if it has the required structure,
not because it shares the same name. This can lead to unexpected
compatibility between types that are conceptually distinct but
structurally identical.
Function Variance (Covariant in arguments): TypeScript's function
arguments are technically bivariant (treated as both covariant and
contravariant), which is unsound. This allows a function requiring a
specific subtype to be replaced by a function accepting a supertype,
or vice versa, leading to potential issues at runtime.
Implicit any and unknown Loopholes: While strict mode significantly
limits any, its existence and the flexibility of casting to and from
unknown can still allow developers to bypass the type system.
Object Property Excess Checking Limitations: Excess property checks
only apply to object literals on creation and assignment, not when
assigning from a variable or when using object spreading, which can
hide errors.
Class Accessibility and Private Fields: Traditional private fields in
TypeScript are not strictly enforced at runtime and are still
accessible via certain mechanisms like bracket notation. The new #
private fields are runtime-enforced but can be bypassed in other ways
(e.g., in functions that access the original closure).