Skip to content

Commit 196ddf4

Browse files
committed
test: update fixture
1 parent cb7a485 commit 196ddf4

File tree

5 files changed

+14
-26
lines changed

5 files changed

+14
-26
lines changed

base/src/main/java/org/aya/resolve/visitor/StmtPreResolver.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public ImmutableSeq<ResolvingStmt> resolveStmt(@NotNull ImmutableSeq<Stmt> stmts
146146
};
147147
}
148148

149-
private @NotNull ResolvingStmt resolveDecl(@NotNull Decl predecl, @NotNull ModuleContext context) {
149+
private @Nullable ResolvingStmt resolveDecl(@NotNull Decl predecl, @NotNull ModuleContext context) {
150150
return switch (predecl) {
151151
case DataDecl decl -> {
152152
var ctx = resolveTopLevelDecl(decl, context);
@@ -185,13 +185,15 @@ public ImmutableSeq<ResolvingStmt> resolveStmt(@NotNull ImmutableSeq<Stmt> stmts
185185
var primID = PrimDef.ID.find(name);
186186
if (primID == null) {
187187
foundError(context, new PrimResolveError.UnknownPrim(sourcePos, name));
188+
yield null;
188189
} else {
189190
var lack = factory.checkDependency(primID);
190-
// TODO: panic
191191
if (lack.isNotEmpty() && lack.get().isNotEmpty()) {
192192
foundError(context, new PrimResolveError.Dependency(name, lack.get(), sourcePos));
193+
yield null;
193194
} else if (factory.isForbiddenRedefinition(primID, false)) {
194195
foundError(context, new PrimResolveError.Redefinition(name, sourcePos));
196+
yield null;
195197
}
196198

197199
factory.factory(primID, decl.ref);

cli-impl/src/test/resources/negative/ClassError.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ In file $FILE:3:30 ->
3535

3636
Error: Unknown member `ummm` projected
3737

38-
Resolving interrupted due to:
3938
1 error(s), 0 warning(s).
4039
Let's learn from that.
4140

cli-impl/src/test/resources/negative/OperatorError.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ In file $FILE:3:28 ->
2222

2323
Error: Circular precedence found between b, c, d
2424

25-
Resolving interrupted due to:
2625
1 error(s), 0 warning(s).
2726
Let's learn from that.
2827

@@ -72,7 +71,6 @@ In file $FILE:2:9 ->
7271

7372
Error: Self bind is not allowed
7473

75-
Resolving interrupted due to:
7674
1 error(s), 0 warning(s).
7775
Let's learn from that.
7876

cli-impl/src/test/resources/negative/ScopeError.txt

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ Error: The unqualified name `zero` is ambiguous
3030
`Nat1::zero`
3131
`Nat2::zero`
3232

33-
Resolving interrupted due to:
3433
1 error(s), 2 warning(s).
3534
Let's learn from that.
3635

@@ -61,7 +60,6 @@ In file $FILE:2:0 ->
6160
Error: The name `zero` being exported clashes with another exported definition
6261
with the same name
6362

64-
Resolving interrupted due to:
6563
1 error(s), 2 warning(s).
6664
Let's learn from that.
6765

@@ -75,8 +73,16 @@ In file $FILE:2:11 ->
7573
Error: The name `suc` is not defined in the current scope
7674
Did you mean: `Nat::suc`
7775

78-
Resolving interrupted due to:
79-
1 error(s), 0 warning(s).
76+
In file $FILE:2:15 ->
77+
78+
1 │ inductive Nat | zero | suc Nat
79+
2 │ def one => suc zero
80+
│ ╰──╯
81+
82+
Error: The name `zero` is not defined in the current scope
83+
Did you mean: `Nat::zero`
84+
85+
2 error(s), 0 warning(s).
8086
Let's learn from that.
8187

8288
ImportDefineShadow:
@@ -102,7 +108,6 @@ In file $FILE:4:14 ->
102108

103109
Error: The qualified name `A::bar` is not defined in the current scope
104110

105-
Resolving interrupted due to:
106111
1 error(s), 0 warning(s).
107112
Let's learn from that.
108113

@@ -116,7 +121,6 @@ In file $FILE:4:15 ->
116121

117122
Error: The qualified name `A::bar` is not defined in the current scope
118123

119-
Resolving interrupted due to:
120124
1 error(s), 0 warning(s).
121125
Let's learn from that.
122126

@@ -143,7 +147,6 @@ In file $FILE:3:2 ->
143147

144148
Error: The name zero (`zero`) is already defined elsewhere
145149

146-
Resolving interrupted due to:
147150
1 error(s), 0 warning(s).
148151
Let's learn from that.
149152

@@ -155,7 +158,6 @@ In file $FILE:1:12 ->
155158

156159
Error: Redefinition of primitive `I`
157160

158-
Resolving interrupted due to:
159161
1 error(s), 0 warning(s).
160162
Let's learn from that.
161163

@@ -167,7 +169,6 @@ In file $FILE:1:5 ->
167169

168170
Error: The primitive `Path` depends on undeclared primitive(s): `I`
169171

170-
Resolving interrupted due to:
171172
1 error(s), 0 warning(s).
172173
Let's learn from that.
173174

@@ -179,7 +180,6 @@ In file $FILE:1:5 ->
179180

180181
Error: Unknown primitive `senpaiSuki`
181182

182-
Resolving interrupted due to:
183183
1 error(s), 0 warning(s).
184184
Let's learn from that.
185185

@@ -192,7 +192,6 @@ In file $FILE:2:9 ->
192192

193193
Error: The qualified name `Nat::suc` is not defined in the current scope
194194

195-
Resolving interrupted due to:
196195
1 error(s), 0 warning(s).
197196
Let's learn from that.
198197

@@ -209,7 +208,6 @@ In file $FILE:3:29 ->
209208

210209
Error: The name `b` is not defined in the current scope
211210

212-
Resolving interrupted due to:
213211
1 error(s), 0 warning(s).
214212
Let's learn from that.
215213

@@ -223,7 +221,6 @@ In file $FILE:3:7 ->
223221

224222
Error: The generalized variable `A` is not available here
225223

226-
Resolving interrupted due to:
227224
1 error(s), 0 warning(s).
228225
Let's learn from that.
229226

@@ -236,7 +233,6 @@ In file $FILE:2:7 ->
236233

237234
Error: The module name `A` is already defined elsewhere
238235

239-
Resolving interrupted due to:
240236
1 error(s), 0 warning(s).
241237
Let's learn from that.
242238

@@ -248,7 +244,6 @@ In file $FILE:1:7 ->
248244

249245
Error: The module name `hopefullyThisModuleWillNeverExist` is not found
250246

251-
Resolving interrupted due to:
252247
1 error(s), 0 warning(s).
253248
Let's learn from that.
254249

@@ -261,7 +256,6 @@ In file $FILE:1:5 ->
261256
Error: The module name `hopefullyThisModuleWillNeverExist` is not defined in the
262257
current scope
263258

264-
Resolving interrupted due to:
265259
1 error(s), 0 warning(s).
266260
Let's learn from that.
267261

@@ -286,7 +280,6 @@ In file $FILE:4:12 ->
286280
Error: The name `t` being exported clashes with another exported definition with
287281
the same name
288282

289-
Resolving interrupted due to:
290283
1 error(s), 1 warning(s).
291284
Let's learn from that.
292285

@@ -299,7 +292,6 @@ In file $FILE:2:24 ->
299292

300293
Error: Unknown member `B` projected
301294

302-
Resolving interrupted due to:
303295
1 error(s), 0 warning(s).
304296
Let's learn from that.
305297

cli-impl/src/test/resources/negative/TerckError.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ In file $FILE:1:10 ->
4646

4747
Error: Self-reference found in the signature of SelfData
4848

49-
Resolving interrupted due to:
5049
1 error(s), 0 warning(s).
5150
Let's learn from that.
5251

@@ -58,7 +57,6 @@ In file $FILE:1:21 ->
5857

5958
Error: Self-reference found in the signature of SelfCon
6059

61-
Resolving interrupted due to:
6260
1 error(s), 0 warning(s).
6361
Let's learn from that.
6462

@@ -72,7 +70,6 @@ In file $FILE:2:4 ->
7270

7371
Error: Self-reference found in the signature of crazyAdd
7472

75-
Resolving interrupted due to:
7673
1 error(s), 0 warning(s).
7774
Let's learn from that.
7875

0 commit comments

Comments
 (0)