File: 064_functorDty.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 (56 lines) | stat: -rw-r--r-- 1,271 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
49
50
51
52
53
54
55
56
functor F (A : sig
  datatype foo = A
  datatype bar = B
  datatype bas = C
  datatype hoge = H
end) =
struct
  fun f (x) = x
end

(*
2011-08-24 katsu

This causes BUG at NameEval.

[BUG] EvalITy: free tvar:'a(tv33)
    raised at: ../types/main/EvalIty.sml:73.20-73.79
   handled at: ../typeinference2/main/InferTypes.sml:3001.36
                ../typeinference2/main/InferTypes.sml:3478.28
                ../typeinference2/main/InferTypes.sml:3478.28
                ../toplevel2/main/Top.sml:766.65-766.68
                ../toplevel2/main/Top.sml:868.37
                main/SimpleMain.sml:359.53
*)

(*
2011-08-25 ohori

Fixed by 2611:6a75e4b92776
This is due to two bugs.
1. CONty of con is given through functor argument is not properly
   given a polytype in NamaEval.sml.
2. FUN_DTY tfun remains and should be interpreted in EvalITy.sml

*)

(* 2012-8-6 ohori
 The printer does not work well for this:
# use "064_functorDty.sml";
064_functorDty.sml:5.3-5.22 Warning: match nonexhaustive
      A.SOME x => ...
functor F
  (sig
    datatype 'a t = NONE | SOME of 'a
    
    
  end) =
    sig
      val f
    end
*)
(* 2012-8-7 ohori 
   Made an ad-hoc fix (4378:5e44dff2dce3) 
   by filtering out IDSPECCON in varE
   just before printing in module Reify.sml
*)