A lot of small changes, added better error messages for bugs mainly

This commit is contained in:
sebastianselander 2023-05-11 18:37:03 +02:00
parent 5e1c81beb7
commit 6260dc2c41
10 changed files with 37 additions and 39 deletions

View file

@ -2,7 +2,7 @@
{-# LANGUAGE OverloadedRecordDot #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# OPTIONS_GHC -Wno-incomplete-patterns #-}
-- {-# OPTIONS_GHC -Wno-incomplete-patterns #-}
module TypeChecker.TypeCheckerBidir (typecheck) where
@ -248,6 +248,7 @@ checkPattern PCatch a = apply (T.PCatch, a)
-- ------------------------- PLit
-- Γ ⊢ lit ↑ A ⊣ Γ
checkPattern (PLit lit) a | a == typeof lit = apply (T.PLit lit, a)
checkPattern (PLit lit) a = error $ "\n -- MARTIN HJÄLP!! --\nUnimplemented match for: '" ++ printTree a ++ "' == '" ++ printTree (typeof lit) ++ "'"
-- Γ ∋ (K : T) Γ ⊢ A <: B ⊣ Δ
-- ---------------------------