@@ -9,18 +9,6 @@ module M with {
9
9
// module method self that returns itself
10
10
fun self(): module M = M
11
11
}
12
- //│ FAILURE: Unexpected exception
13
- //│ /!!!\ Uncaught error: java.lang.Exception: Internal Error: keyword 'module' does not have right precedence
14
- //│ at: mlscript.utils.package$.lastWords(package.scala:211)
15
- //│ at: hkmc2.syntax.Keyword.assumeRightPrec$$anonfun$1(Keyword.scala:31)
16
- //│ at: scala.Option.getOrElse(Option.scala:201)
17
- //│ at: hkmc2.syntax.Keyword.assumeRightPrec(Keyword.scala:31)
18
- //│ at: hkmc2.syntax.Parser.parseRuleImpl(Parser.scala:351)
19
- //│ at: hkmc2.syntax.Parser.parseRule$$anonfun$2(Parser.scala:321)
20
- //│ at: hkmc2.syntax.Parser.wrap(Parser.scala:129)
21
- //│ at: hkmc2.syntax.Parser.parseRule(Parser.scala:321)
22
- //│ at: hkmc2.syntax.Parser.expr(Parser.scala:460)
23
- //│ at: hkmc2.syntax.Parser.exprContImpl(Parser.scala:921)
24
12
25
13
:e
26
14
fun f1(module m)
@@ -34,106 +22,42 @@ fun f2[T](module m: T)
34
22
module N with {
35
23
fun f3(): M = M
36
24
}
37
- //│ ╔══[ERROR] Name not found: M
38
- //│ ║ l.35: fun f3(): M = M
39
- //│ ╙── ^
40
- //│ ╔══[ERROR] Name not found: M
41
- //│ ║ l.35: fun f3(): M = M
42
- //│ ╙── ^
25
+ //│ FAILURE: Unexpected lack of type error
43
26
44
27
:e
45
28
module N with {
46
29
fun f4[T](): module T = M
47
30
}
48
- //│ FAILURE: Unexpected exception
49
- //│ /!!!\ Uncaught error: java.lang.Exception: Internal Error: keyword 'module' does not have right precedence
50
- //│ at: mlscript.utils.package$.lastWords(package.scala:211)
51
- //│ at: hkmc2.syntax.Keyword.assumeRightPrec$$anonfun$1(Keyword.scala:31)
52
- //│ at: scala.Option.getOrElse(Option.scala:201)
53
- //│ at: hkmc2.syntax.Keyword.assumeRightPrec(Keyword.scala:31)
54
- //│ at: hkmc2.syntax.Parser.parseRuleImpl(Parser.scala:351)
55
- //│ at: hkmc2.syntax.Parser.parseRule$$anonfun$2(Parser.scala:321)
56
- //│ at: hkmc2.syntax.Parser.wrap(Parser.scala:129)
57
- //│ at: hkmc2.syntax.Parser.parseRule(Parser.scala:321)
58
- //│ at: hkmc2.syntax.Parser.expr(Parser.scala:460)
59
- //│ at: hkmc2.syntax.Parser.exprContImpl(Parser.scala:921)
31
+ //│ FAILURE: Unexpected lack of type error
60
32
61
33
:e
62
34
module N with {
63
35
fun f5(): M = M
64
36
}
65
- //│ ╔══[ERROR] Name not found: M
66
- //│ ║ l.63: fun f5(): M = M
67
- //│ ╙── ^
68
- //│ ╔══[ERROR] Name not found: M
69
- //│ ║ l.63: fun f5(): M = M
70
- //│ ╙── ^
37
+ //│ FAILURE: Unexpected lack of type error
71
38
72
39
73
40
fun f6(m: M)
74
- //│ FAILURE: Unexpected type error
75
- //│ ╔══[ERROR] Name not found: M
76
- //│ ║ l.73: fun f6(m: M)
77
- //│ ╙── ^
78
41
79
42
:e
80
43
f6(M)
81
- //│ ╔══[ERROR] Name not found: M
82
- //│ ║ l.80: f6(M)
83
- //│ ╙── ^
44
+ //│ FAILURE: Unexpected lack of type error
84
45
85
46
:e
86
47
f6(M.self())
87
- //│ ╔══[ERROR] Name not found: M
88
- //│ ║ l.86: f6(M.self())
89
- //│ ╙── ^
48
+ //│ FAILURE: Unexpected lack of type error
90
49
91
50
:e
92
51
fun f7(): module M
93
- //│ FAILURE: Unexpected exception
94
- //│ /!!!\ Uncaught error: java.lang.Exception: Internal Error: keyword 'module' does not have right precedence
95
- //│ at: mlscript.utils.package$.lastWords(package.scala:211)
96
- //│ at: hkmc2.syntax.Keyword.assumeRightPrec$$anonfun$1(Keyword.scala:31)
97
- //│ at: scala.Option.getOrElse(Option.scala:201)
98
- //│ at: hkmc2.syntax.Keyword.assumeRightPrec(Keyword.scala:31)
99
- //│ at: hkmc2.syntax.Parser.parseRuleImpl(Parser.scala:351)
100
- //│ at: hkmc2.syntax.Parser.parseRule$$anonfun$2(Parser.scala:321)
101
- //│ at: hkmc2.syntax.Parser.wrap(Parser.scala:129)
102
- //│ at: hkmc2.syntax.Parser.parseRule(Parser.scala:321)
103
- //│ at: hkmc2.syntax.Parser.expr(Parser.scala:460)
104
- //│ at: hkmc2.syntax.Parser.exprContImpl(Parser.scala:921)
52
+ //│ FAILURE: Unexpected lack of type error
105
53
106
54
107
55
fun ok1(module m: M)
108
- //│ FAILURE: Unexpected type error
109
- //│ ╔══[ERROR] Name not found: M
110
- //│ ║ l.107: fun ok1(module m: M)
111
- //│ ╙── ^
112
56
113
57
module N with {
114
58
fun ok2(): module M = M
115
59
}
116
- //│ FAILURE: Unexpected exception
117
- //│ /!!!\ Uncaught error: java.lang.Exception: Internal Error: keyword 'module' does not have right precedence
118
- //│ at: mlscript.utils.package$.lastWords(package.scala:211)
119
- //│ at: hkmc2.syntax.Keyword.assumeRightPrec$$anonfun$1(Keyword.scala:31)
120
- //│ at: scala.Option.getOrElse(Option.scala:201)
121
- //│ at: hkmc2.syntax.Keyword.assumeRightPrec(Keyword.scala:31)
122
- //│ at: hkmc2.syntax.Parser.parseRuleImpl(Parser.scala:351)
123
- //│ at: hkmc2.syntax.Parser.parseRule$$anonfun$2(Parser.scala:321)
124
- //│ at: hkmc2.syntax.Parser.wrap(Parser.scala:129)
125
- //│ at: hkmc2.syntax.Parser.parseRule(Parser.scala:321)
126
- //│ at: hkmc2.syntax.Parser.expr(Parser.scala:460)
127
- //│ at: hkmc2.syntax.Parser.exprContImpl(Parser.scala:921)
128
60
129
61
ok1(M)
130
- //│ FAILURE: Unexpected type error
131
- //│ ╔══[ERROR] Name not found: M
132
- //│ ║ l.129: ok1(M)
133
- //│ ╙── ^
134
62
135
63
ok1(M.self())
136
- //│ FAILURE: Unexpected type error
137
- //│ ╔══[ERROR] Name not found: M
138
- //│ ║ l.135: ok1(M.self())
139
- //│ ╙── ^
0 commit comments