From 0ae79efdbf8cb4a42d61a281e243b839b1b929e3 Mon Sep 17 00:00:00 2001 From: hallgren Date: Fri, 4 Apr 2014 16:50:12 +0000 Subject: [PATCH] TypeCheck.RConcrete: contravariance in table types --- src/compiler/GF/Compile/TypeCheck/RConcrete.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/GF/Compile/TypeCheck/RConcrete.hs b/src/compiler/GF/Compile/TypeCheck/RConcrete.hs index 4bbd42271..16c6908da 100644 --- a/src/compiler/GF/Compile/TypeCheck/RConcrete.hs +++ b/src/compiler/GF/Compile/TypeCheck/RConcrete.hs @@ -683,7 +683,8 @@ checkIfEqLType gr g t u trm = do (Q (m,a), QC (n,b)) | a == b -> elem m (allExtendsPlus gr n) || elem n (allExtendsPlus gr m) - (Table a b, Table c d) -> alpha g a c && alpha g b d + -- contravariance + (Table a b, Table c d) -> alpha g c a && alpha g b d (Vr x, Vr y) -> x == y || elem (x,y) g || elem (y,x) g _ -> t == u --- the following should be one-way coercions only. AR 4/1/2001