File: Test116.ML

package info (click to toggle)
polyml 5.6-8
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 31,892 kB
  • ctags: 34,453
  • sloc: cpp: 44,983; ansic: 24,520; asm: 14,850; sh: 11,730; makefile: 551; exp: 484; python: 253; awk: 91; sed: 9
file content (22 lines) | stat: -rw-r--r-- 767 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(* This produced an InternalError exception in SVN 1192. *)

structure Q = struct type t = int fun s _ = 0 end;

(* There are three properties of this example which are needed to show the bug.
   There must be no result signature on the functor.
   There must be no semicolon between the functor declaration and the
   structure.
   There must be a result signature on the structure declaration. *)

functor F(S: sig type t val s: string -> t end)
= struct type t = S.t val s = S.s end

(* N.B.  No semicolon here. *)

structure T: sig type t val s: string -> t end = F(Q)
;

(* Additional check that F can be applied to more than one type. *)
structure R = struct type t = string fun s _ = "hello" end;

structure A: sig type t=string val s: string -> t end = F(R);