Skip to content

Instantly share code, notes, and snippets.

View madsimian's full-sized avatar

Jonathan Broad madsimian

  • Madison, WI, USA
View GitHub Profile
@madsimian
madsimian / typeguard_in_inner_function2.ts
Last active December 19, 2019 15:30 — forked from jrheling/typeguard_in_inner_function2.ts
typescript type guards around closure definitions are ignored by the inner function
// Typescript handles type guards fundamentally differently than it
// handles data in the context of a closure.
//
// This is not new, and was documented at
// https://github.com/microsoft/TypeScript/issues/7662
// and
// https://github.com/microsoft/TypeScript/issues/8552
//
// Demonstration follows.