You can output assembly with any toolchain, yes. But there's no runtime, at least if you mean in the sense that the code is executed by a runtime.
declare const brand: unique symbol;
type NonEmptyString = string & { readonly [brand]: 'NonEmptyString' };
// the ONLY non-cast way to produce one
export function nonEmptyString(s: string): NonEmptyString | undefined {
return s.length > 0 ? (s as NonEmptyString) : undefined;
}
export type { NonEmptyString }; const m = { name: "weavejester", active: true };
const mStar = { ...m, number: 3 };
// ^? const mStar: { number: number, name: string, active: boolean }
const x = mStar.number;
// ^? const x: number
> This is the ultimate problem with static type systems: you're trading capability for safety. If you're programming within a static type system, there are options that are simply not available or feasible to use.