feat: add tuple index access, multiline args, and effect unification fix
- Tuple index: `pair.0`, `pair.1` syntax across parser, typechecker, interpreter, C/JS backends, formatter, linter, and symbol table - Multi-line function args: allow newlines inside argument lists - Fix effect unification for callback parameters (empty expected effects means "no constraint", not "must be pure") Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2040,7 +2040,9 @@ pub fn unify(t1: &Type, t2: &Type) -> Result<Substitution, String> {
|
||||
// Function's required effects (e1) must be a subset of available effects (e2)
|
||||
// A pure function (empty effects) can be called anywhere
|
||||
// A function requiring {Logger} can be called in context with {Logger} or {Logger, Console}
|
||||
if !e1.is_subset(&e2) {
|
||||
// When expected effects (e2) are empty, it means "no constraint" (e.g., callback parameter)
|
||||
// so we allow any actual effects through
|
||||
if !e2.is_empty() && !e1.is_subset(&e2) {
|
||||
return Err(format!(
|
||||
"Effect mismatch: expected {{{}}}, got {{{}}}",
|
||||
e1, e2
|
||||
|
||||
Reference in New Issue
Block a user