Skip to content

Commit a2020a6

Browse files
[Mojo] Emit error when parametric function is passed as argument (#31044)
This is never legal, so the parser should catch it. The patch also changes an assert in the parser that could get triggered if a parametric function is passed as an argument: if the argument is called inside a closure, the parser would crash because closure bodies are resolved even if the parent function had a decl resolution error. From now on, this assert will just turn into a suppressed error if and only if the a parent func had a resolution error. Closes [Internal Link] modular-orig-commit: b1065e081f805239fb668ae014e46f86e71e7025
1 parent 8a60cb7 commit a2020a6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ for x in v:
234234
[#1230](https://github.com/modularml/mojo/issues/1230),
235235
[#1699](https://github.com/modularml/mojo/issues/1699),
236236
[#1708](https://github.com/modularml/mojo/issues/1708)
237+
- [#1223](https://github.com/modularml/mojo/issues/1223) - Crash when parametric
238+
function is passed as (runtime) argument. The parser now errors out instead.
237239

238240
## v0.7.0 (2024-01-25)
239241

0 commit comments

Comments
 (0)