Incremental static typechecking

Related: Have I hit compiler bugs? - #25 by ysbaddaden