# 057: tysigterm.hs で renExp: ExpWithTySig 未対応エラー [↑up](bunny_notes) - issued: 2020-05-04 - 分類: A サンプルコードが fail - status: Closed (2020-05-04) ## 概要 明示型付きの項に対応していないので、次のようなプログラム (tysigtem.hs) でエラーする。 $$
{
main = print (512 :: Int)
$$}
現象:
$${
./tcheck testcases/tysigterm.hs
# 1. test-compile
source file: testcases/tysigterm.hs
dst dir: /tysigterm
doCompile ... done.
implicitPrelude ... done.
doCompile ... bunnyc: Non-exhaustive patterns in renExp: ExpWithTySig (LitExp (LitInteger 512 (1,15))) (Nothing,Tycon (Name {origName = "Int", namePos = (1,22), isConName = True}))
CallStack (from HasCallStack):
error, called at src/Rename.hs:668:12 in main:Rename
$$}
${foo :: tysig} は、Rename (型推論の前) に、
次のような let 式に変換してやればよいと思われる。
$${
let
x :: tysig
x = foo
in x
$$}
## 調査ログ
### 2020-05-04
上記方針通りに実装、クローズ。
tysigterm.hs は sample172 とした。