Skip to content

craigtaub/our-own-type-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Our own type system

A compiler which checks types for 3 scenarios:

  1. Issue with un-compatible types on declaration and expression
fn("craig-string"); // throw with string vs number
function fn(a: number) {}
  1. Issue with unknown type on declaration and expression
fn("craig-string"); // throw with string vs ?
function fn(a: made_up_type) {} // throw with bad type
  1. Issue with property name
interface Person {
  name: string;
}
fn({ nam: "craig" }); // throw with "nam" vs "name"
function fn(a: Person) {}

Releases

No releases published

Packages

No packages published