Skip to content

Commit de1fd2f

Browse files
committed
revert part of "misc: sync with upstream"
1 parent 58bd65d commit de1fd2f

File tree

5 files changed

+36
-36
lines changed

5 files changed

+36
-36
lines changed

hkmc2/shared/src/test/mlscript/basics/BadModuleUses.mls

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module Example with
1616
:e
1717
let m = Example.foo()
1818
//│ ╔══[ERROR] Unexpected moduleful application.
19-
//│ ║ l.16: let m = Example.foo()
19+
//│ ║ l.17: let m = Example.foo()
2020
//│ ╙── ^^^^^^^^^^^^^
2121
//│ m = M
2222

@@ -32,7 +32,7 @@ Example.foo()
3232
:e
3333
id(Example.foo())
3434
//│ ╔══[ERROR] Unexpected moduleful application.
35-
//│ ║ l.30: id(Example.foo())
35+
//│ ║ l.33: id(Example.foo())
3636
//│ ║ ^^^^^^^^^^^^^
3737
//│ ╙── Module argument passed to a non-module parameter.
3838
//│ = M
@@ -43,29 +43,29 @@ Example.foo().mtd()
4343
:e
4444
Example.foo() + 1
4545
//│ ╔══[ERROR] Unexpected moduleful application.
46-
//│ ║ l.40: Example.foo() + 1
46+
//│ ║ l.44: Example.foo() + 1
4747
//│ ╙── ^^^^^^^^^^^^^
4848
//│ = "M1"
4949

5050
:e
5151
M + 1
5252
//│ ╔══[ERROR] Unexpected moduleful reference.
53-
//│ ║ l.45: M + 1
53+
//│ ║ l.51: M + 1
5454
//│ ╙── ^
5555
//│ = "M1"
5656

5757
:e
5858
M |> id
5959
//│ ╔══[ERROR] Unexpected moduleful reference.
60-
//│ ║ l.50: M |> id
60+
//│ ║ l.58: M |> id
6161
//│ ║ ^
6262
//│ ╙── Module argument passed to a non-module parameter.
6363
//│ = M
6464

6565
:e
6666
id <| M
6767
//│ ╔══[ERROR] Unexpected moduleful reference.
68-
//│ ║ l.57: id <| M
68+
//│ ║ l.66: id <| M
6969
//│ ║ ^
7070
//│ ╙── Module argument passed to a non-module parameter.
7171
//│ = M
@@ -75,15 +75,15 @@ fun (+) lol(a, b) = [a, b]
7575
:e
7676
M + 1
7777
//│ ╔══[ERROR] Unexpected moduleful reference.
78-
//│ ║ l.66: M + 1
78+
//│ ║ l.76: M + 1
7979
//│ ║ ^
8080
//│ ╙── Module argument passed to a non-module parameter.
8181
//│ = [M, 1]
8282

8383
:e
8484
let m = M
8585
//│ ╔══[ERROR] Unexpected moduleful reference.
86-
//│ ║ l.73: let m = M
86+
//│ ║ l.84: let m = M
8787
//│ ╙── ^
8888
//│ m = M
8989

@@ -95,7 +95,7 @@ module B with
9595
val a: module A = A
9696
print(B.a)
9797
//│ ╔══[ERROR] Unexpected moduleful selection.
98-
//│ ║ l.83: print(B.a)
98+
//│ ║ l.96: print(B.a)
9999
//│ ╙── ^^^
100100
//│ > A
101101

hkmc2/shared/src/test/mlscript/basics/MiscArrayTests.mls

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ xs
6565
//│ rhs = Tup of Ls of
6666
//│ Ident of "f"
6767
//│ ╔══[ERROR] Expected 2 arguments, got 1
68-
//│ ║ l.53: . map(f)
68+
//│ ║ l.56: . map(f)
6969
//│ ╙── ^^^
7070
//│ ═══[RUNTIME ERROR] Error: Function 'map' expected 2 arguments but got 1
7171

7272
:fixme
7373
xs
7474
. map(x => x * 2)
7575
//│ ╔══[ERROR] Expected 2 arguments, got 1
76-
//│ ║ l.68: . map(x => x * 2)
76+
//│ ║ l.74: . map(x => x * 2)
7777
//│ ╙── ^^^
7878
//│ ═══[RUNTIME ERROR] Error: Function 'map' expected 2 arguments but got 1
7979

@@ -82,7 +82,7 @@ xs
8282
. map(x => x * 2)
8383
. print()
8484
//│ ╔══[ERROR] Expected 2 arguments, got 1
85-
//│ ║ l.73: . map(x => x * 2)
85+
//│ ║ l.82: . map(x => x * 2)
8686
//│ ╙── ^^^
8787
//│ ═══[RUNTIME ERROR] Error: Function 'map' expected 2 arguments but got 1
8888

hkmc2/shared/src/test/mlscript/basics/ModuleMethods.mls

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fun f(m)
1717
:e
1818
f(M)
1919
//│ ╔══[ERROR] Unexpected moduleful reference.
20-
//│ ║ l.15: f(M)
20+
//│ ║ l.18: f(M)
2121
//│ ║ ^
2222
//│ ╙── Module argument passed to a non-module parameter.
2323

@@ -26,7 +26,7 @@ f(42)
2626
:e
2727
fun f(module m)
2828
//│ ╔══[ERROR] Module parameter must have explicit type.
29-
//│ ║ l.23: fun f(module m)
29+
//│ ║ l.27: fun f(module m)
3030
//│ ╙── ^
3131

3232
fun f(module m: M)
@@ -38,7 +38,7 @@ f(M)
3838
:e
3939
fun f[T](module m: T)
4040
//│ ╔══[ERROR] Expected a module, found non-moduleful reference.
41-
//│ ║ l.35: fun f[T](module m: T)
41+
//│ ║ l.39: fun f[T](module m: T)
4242
//│ ║ ^
4343
//│ ╙── Module parameter must have a module type.
4444

@@ -61,18 +61,18 @@ fun assertNonMM[T](m)
6161
:e
6262
fun f() = M
6363
//│ ╔══[ERROR] Unexpected moduleful reference.
64-
//│ ║ l.57: fun f() = M
64+
//│ ║ l.62: fun f() = M
6565
//│ ║ ^
6666
//│ ╙── Function must be marked as returning a 'module' in order to return a module.
6767

6868
:e
6969
fun f(): M = M
7070
//│ ╔══[ERROR] Unexpected moduleful reference.
71-
//│ ║ l.63: fun f(): M = M
71+
//│ ║ l.69: fun f(): M = M
7272
//│ ║ ^
7373
//│ ╙── Function must be marked as returning a 'module' in order to have a module return type.
7474
//│ ╔══[ERROR] Unexpected moduleful reference.
75-
//│ ║ l.63: fun f(): M = M
75+
//│ ║ l.69: fun f(): M = M
7676
//│ ║ ^
7777
//│ ╙── Function must be marked as returning a 'module' in order to return a module.
7878

@@ -81,7 +81,7 @@ fun f(): module M = M
8181
:e
8282
assertNonM(f())
8383
//│ ╔══[ERROR] Unexpected moduleful application.
84-
//│ ║ l.76: assertNonM(f())
84+
//│ ║ l.82: assertNonM(f())
8585
//│ ║ ^^^
8686
//│ ╙── Module argument passed to a non-module parameter.
8787

@@ -90,7 +90,7 @@ assertM(f())
9090
:e
9191
fun f4[T](): module T = M
9292
//│ ╔══[ERROR] Expected a module, found non-moduleful reference.
93-
//│ ║ l.84: fun f4[T](): module T = M
93+
//│ ║ l.91: fun f4[T](): module T = M
9494
//│ ║ ^
9595
//│ ╙── Function marked as returning a 'module' must have a module return type.
9696

@@ -99,8 +99,8 @@ fun f[T](): module MM[T] = MM[T]
9999
:e
100100
assertNonM(f[Int]())
101101
//│ ╔══[ERROR] Unexpected moduleful application.
102-
//│ ║ l.97: assertNonM(f[Int]())
103-
//│ ║ ^^^^^^^^
102+
//│ ║ l.100: assertNonM(f[Int]())
103+
//│ ║ ^^^^^^^^
104104
//│ ╙── Module argument passed to a non-module parameter.
105105

106106
assertM(f[Int]())
@@ -110,14 +110,14 @@ assertM(f[Int]())
110110
:e
111111
fun f3() = return M
112112
//│ ╔══[ERROR] Unexpected moduleful reference.
113-
//│ ║ l.105: fun f3() = return M
113+
//│ ║ l.111: fun f3() = return M
114114
//│ ╙── ^
115115

116116
:todo
117117
:e
118118
fun f3() = (() => M)()
119119
//│ ╔══[ERROR] Unexpected moduleful reference.
120-
//│ ║ l.109: fun f3() = (() => M)()
120+
//│ ║ l.118: fun f3() = (() => M)()
121121
//│ ╙── ^
122122

123123
// * [test:T4]
@@ -126,7 +126,7 @@ fun f3() = (() => M)()
126126
:effectHandlers
127127
fun f3() = (() => return M)()
128128
//│ ╔══[ERROR] Unexpected moduleful reference.
129-
//│ ║ l.115: fun f3() = (() => return M)()
129+
//│ ║ l.127: fun f3() = (() => return M)()
130130
//│ ╙── ^
131131

132132

@@ -136,7 +136,7 @@ fun f3() = (() => return M)()
136136
:e
137137
fun f(module m: M) = m
138138
//│ ╔══[ERROR] Unexpected moduleful reference.
139-
//│ ║ l.122: fun f(module m: M) = m
139+
//│ ║ l.137: fun f(module m: M) = m
140140
//│ ║ ^
141141
//│ ╙── Function must be marked as returning a 'module' in order to return a module.
142142

@@ -149,7 +149,7 @@ fun f(module m: M): module M = m
149149
:e
150150
val v = M
151151
//│ ╔══[ERROR] Unexpected moduleful reference.
152-
//│ ║ l.139: val v = M
152+
//│ ║ l.150: val v = M
153153
//│ ║ ^
154154
//│ ╙── Value must be marked as returning a 'module' in order to return a module.
155155

@@ -172,8 +172,8 @@ class C with
172172
fun foo: module M = M
173173
val bar: module M = M
174174
//│ ╔══[ERROR] Function returning modules should not be a class member.
175-
//│ ║ l.165: fun foo: module M = M
175+
//│ ║ l.172: fun foo: module M = M
176176
//│ ╙── ^^^^^
177177
//│ ╔══[ERROR] Value returning modules should not be a class member.
178-
//│ ║ l.166: val bar: module M = M
178+
//│ ║ l.173: val bar: module M = M
179179
//│ ╙── ^^^^^

hkmc2/shared/src/test/mlscript/bbml/bbGetters.mls

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fun test2() =
8282
case n then funny(n - 1) + 1
8383
funny
8484
//│ ╔══[WARNING] Pure expression in statement position
85-
//│ ║ l.79: case 0 then 0
85+
//│ ║ l.81: case 0 then 0
8686
//│ ╙── ^
8787
//│ JS (unsanitized):
8888
//│ let test22;
@@ -104,15 +104,15 @@ fun test2() =
104104
//│ return tmp1
105105
//│ };
106106
//│ ╔══[WARNING] Pure expression in statement position
107-
//│ ║ l.79: case 0 then 0
107+
//│ ║ l.81: case 0 then 0
108108
//│ ╙── ^
109109
//│ ╔══[ERROR] Function definition shape not yet supported for funny
110-
//│ ║ l.79: case 0 then 0
110+
//│ ║ l.81: case 0 then 0
111111
//│ ║ ^
112-
//│ ║ l.80: case n then funny(n - 1) + 1
112+
//│ ║ l.82: case n then funny(n - 1) + 1
113113
//│ ╙── ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
114114
//│ ╔══[ERROR] Variable not found: funny
115-
//│ ║ l.81: funny
115+
//│ ║ l.83: funny
116116
//│ ╙── ^^^^^
117117
//│ Type: ⊤
118118

@@ -121,7 +121,7 @@ fun test2() =
121121
fun test3 =
122122
print("Hi")
123123
//│ ╔══[ERROR] Function definition shape not yet supported for test3
124-
//│ ║ l.114: print("Hi")
124+
//│ ║ l.122: print("Hi")
125125
//│ ╙── ^^^^^^^^^^^
126126
//│ Type: ⊤
127127

hkmc2/shared/src/test/mlscript/codegen/BadSpreads.mls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ fun foo(1) = 2
4242

4343
:todo // proper error
4444
fun foo(...1) = 2
45-
//│ /!!!\ Uncaught error: scala.MatchError: Spread(keyword '...',Some(Loc(8,11,BadSpreads.mls:+42)),Some(IntLit(1))) (of class hkmc2.syntax.Tree$Spread)
45+
//│ /!!!\ Uncaught error: scala.MatchError: Spread(keyword '...',Some(Loc(8,11,BadSpreads.mls:+44)),Some(IntLit(1))) (of class hkmc2.syntax.Tree$Spread)
4646

4747

0 commit comments

Comments
 (0)