File: 093_datatype.sml

package info (click to toggle)
smlsharp 4.1.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 123,724 kB
  • sloc: ansic: 16,725; sh: 4,347; makefile: 2,191; java: 742; haskell: 493; ruby: 305; cpp: 284; pascal: 256; ml: 255; lisp: 141; asm: 97; sql: 74
file content (48 lines) | stat: -rw-r--r-- 854 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
datatype t1 = T1 of t2
and t2 = T2
fun f x =
let
  val T1 (y as T2) = x
in
  y
end

(*
2011-08-30 katsu

This causes BUG at DatatypeCompilation due to a bug of InferTypes.

[BUG] 093_datatype.sml:7.3-7.3: variable not found:y(2)
    raised at: ../staticanalysis/main/SAContext.sml:43.13-46.18
   handled at: ../toplevel2/main/Top.sml:868.37
                main/SimpleMain.sml:359.53

After type inference:

val f(0) : t1(t30[]) -> ERRORty =      (*** ERRORty?? ***)
 (fn x(1) : t1(t30[]) =>
  let
   val $T_b(4) : {} =
    case (bind)
     x(1) : t1(t30[])
     :{t1(t30[])}
    of
     T1 $T_a(3) : t2(t31[]) as T2  =>
     ()
      :{}
    : {}
  in
   y(2) : ERRORty : {ERRORty}        (*** y(2) is unbound ***)
  end
  :ERRORty)
*)


(*
2011-08-01 ohori

Fixed. This is a simple bug in varsInPat, and not due to something
related to ifGenterm.

*)