011: trcore-err1.hs がランタイムにおいて abend

↑up

現象

:~/prj/bunny/compiler/jout$ ./run trcore-err1/Sample.java 
Error: Non-exhaustive patterns.
abend!

調査ログ

2020-09-22 (Tue)

タスクのたな卸しをしようと、前から順に確認してみたところ、この件も、いまの版では現象がかわっているようだった。今日実行した結果は以下のように、DictPass での dictionary not found:

$ ./trun testcases/trcore-err1.hs 
# 1. tcompile
source file: testcases/trcore-err1.hs
dst dir: /trcore-err1
doCompile ... done.
implicitPrelude ... done.
doCompile ... bunnyc: Error: dictionary not found: ("Prelude.Ord",Tyvar "t27" Star,[(IsIn "Prelude.Ord" (TVar (Tyvar "t29" Star)),"Main.f.DARG0")])
CallStack (from HasCallStack):
  error, called at src/DictPass.hs:261:25 in main:DictPass
CallStack (from -prof):
  DictPass.findApplyDict.ty2dict (src/DictPass.hs:(233,8)-(261,82))
  DictPass.findApplyDict.mkdicts (src/DictPass.hs:(228,8)-(231,29))
  DictPass.findApplyDict (src/DictPass.hs:(223,1)-(263,35))
  DictPass.tcExpr.tcAs (src/DictPass.hs:(306,5)-(308,25))
  DictPass.tcExpr (src/DictPass.hs:(266,1)-(317,71))
  DictPass.tcBind.tcbind.(...) (src/DictPass.hs:53:13-51)
  DictPass.tcBind.tcbind (src/DictPass.hs:(46,5)-(58,48))
  DictPass.tcBind.tbloop.(...) (src/DictPass.hs:38:32-54)
  DictPass.tcBind.tbloop (src/DictPass.hs:(37,5)-(39,52))
  DictPass.tcBind (src/DictPass.hs:(34,1)-(58,48))
  Main.doCompile.(...) (app/Main.hs:103:7-44)
  Main.doCompile (app/Main.hs:(77,1)-(113,33))
  Main.main (app/Main.hs:(116,1)-(131,42))

--ddump-core0 の結果はこう:

(Main.main :: (Prelude.IO ())) =
    ((Prelude.putStrLn :: ([Prelude.Char] -> (Prelude.IO ()))) $ 
      ((Prelude.show :: ([Prelude.Show t5] :=> (t5 -> [Prelude.Char]))) $ 
        ((Main.f :: ([Prelude.Ord t6] :=> ([t6] -> Prelude.Bool))) 
          "331223")))

(Main.f :: ([Prelude.Ord t29] :=> ([t29] -> Prelude.Bool))) =
    \(_Main.f.U1 :: ([Prelude.Ord t7] :=> [t7])) ->
        case (_Main.f.U1 :: ([Prelude.Ord t7] :=> [t7])) (_Main.f.U1b :: ([Prelude.Ord t7] :=> [t7])) of
            Prelude.: (_Main.f.U2 :: t10) (_Main.f.U3 :: [t10]) :: (t10 -> ([t10] -> [t10])) -> 
                case (_Main.f.U3 :: [t10]) (_Main.f.U3b :: [t10]) of
                    Prelude.: (_Main.f.U3 :: t16) (_Main.f.U4 :: [t16]) :: (t16 -> ([t16] -> [t16])) -> 
                        case (_Main.f.U4 :: [t16]) (_Main.f.U4b :: [t16]) of
                            Prelude.: (_Main.f.U5 :: t25) (_Main.f.U6 :: [t25]) :: (t25 -> ([t25] -> [t25])) -> 
                                ((Main.f :: ([Prelude.Ord t27] :=> ([t27] -> Prelude.Bool))) 
                                  (_Main.f.U3 :: t16))
                            Prelude.[]  :: [t18] -> 
                                (((Prelude.> :: ([Prelude.Ord t22] :=> (t22 -> (t22 -> Prelude.Bool)))) 
                                    (_Main.f.U2 :: t10)) 
                                  (_Main.f.U3 :: t16))
                            
                    Prelude.[]  :: [t12] -> 
                        (Prelude.False :: Prelude.Bool)
                    
            Prelude.[]  :: [t8] -> 
                (Prelude.False :: Prelude.Bool)

2020-10-01 (Thu)

076 と同じ原因だったので、いっしょに解決。 trcore-err1.hs は、sample283.hs とした。