Passes all tests
This commit is contained in:
		@@ -390,10 +390,15 @@
 | 
				
			|||||||
     (let* ([arg-type (parse-type te)]
 | 
					     (let* ([arg-type (parse-type te)]
 | 
				
			||||||
            [res-type (typecheck body (BindType name arg-type env))])
 | 
					            [res-type (typecheck body (BindType name arg-type env))])
 | 
				
			||||||
       (arrowT arg-type res-type))]
 | 
					       (arrowT arg-type res-type))]
 | 
				
			||||||
    [(listE elements) (begin
 | 
					    [(listE elements) (local [(define type-list (map (lambda (x) (typecheck x env)) elements))
 | 
				
			||||||
                        (define type-list (map (lambda (x) (typecheck x env)) elements))
 | 
					                              (define filtered (filter (lambda (x) (equal? (first type-list) x)) type-list))]
 | 
				
			||||||
                        
 | 
					                        (if (equal? filtered type-list)
 | 
				
			||||||
     (listT )]
 | 
					                            (listT (first type-list))
 | 
				
			||||||
 | 
					                            (type-case Type (first type-list)
 | 
				
			||||||
 | 
					                              [(varT v t) (if (none? (unbox t))
 | 
				
			||||||
 | 
					                                            (listT (second type-list))
 | 
				
			||||||
 | 
					                                            (error 'typecheck "no type"))]
 | 
				
			||||||
 | 
					                              [else (error 'typecheck "no type")])))]
 | 
				
			||||||
    ))
 | 
					    ))
 | 
				
			||||||
;; ----------------------------------------
 | 
					;; ----------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user