Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix function calls inference in pipes #3525

Merged
merged 1 commit into from
Aug 19, 2024
Merged

Conversation

sobolevn
Copy link
Contributor

So, why did I make this change?

In some cases return_.fn_arity() was returning None, because return_ was not a function type, but Type::Var { type_ }. Which does not have an arity.

Why is it safe not to check the arity here? Because it will be checked in the second self.expr_typer.do_infer_call_with_known_fun call here:

let (function, args, type_) = self.expr_typer.do_infer_call_with_known_fun(
function,
args,
location,
CallKind::Function,
);
TypedExpr::Call {
location,
type_,
args,
fun: Box::new(function),
}

Closes #3515

@sobolevn
Copy link
Contributor Author

CC @nohzafk @giacomocavalieri

@sobolevn
Copy link
Contributor Author

Oups, somehow unrelated changes got into this PR, removing and updating.

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@lpil lpil merged commit d4effe3 into gleam-lang:main Aug 19, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pipeline issue in 1.4.1
2 participants