Skip to content

Commit 1f66710

Browse files
authored
Merge pull request #124 from NoamDev/disable-begin-infer
2 parents 7fdee06 + 236b046 commit 1f66710

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

src/par/types/checking.rs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,12 @@ impl Context {
349349
captures,
350350
body: process,
351351
} => {
352+
if let Some(inference_subject) = inference_subject {
353+
return Err(TypeError::TypeMustBeKnownAtThisPoint(
354+
span.clone(),
355+
inference_subject.clone(),
356+
));
357+
}
352358
let Type::Recursive {
353359
span: typ_span,
354360
asc: typ_asc,
@@ -393,29 +399,15 @@ impl Context {
393399
object.clone(),
394400
Type::expand_recursive(&typ_asc, typ_label, typ_body)?,
395401
)?;
396-
let (process, inferred_type) = analyze_process(self, process)?;
397-
398-
let inferred_type = inferred_type.map(|body| {
399-
if body.contains_self(label) {
400-
Type::Iterative {
401-
span: span.clone(),
402-
asc: typ_asc,
403-
label: label.clone(),
404-
body: Box::new(body),
405-
}
406-
} else {
407-
body
408-
}
409-
});
410-
402+
let (process, _inferred_type) = analyze_process(self, process)?;
411403
(
412404
Command::Begin {
413405
unfounded: *unfounded,
414406
label: label.clone(),
415407
captures: captures.clone(),
416408
body: process,
417409
},
418-
inferred_type,
410+
None,
419411
)
420412
}
421413

0 commit comments

Comments
 (0)