Skip to content

[JuliaLowering] Fix handling of unnamed args in @generated functions#60226

Merged
topolarity merged 2 commits intoJuliaLang:masterfrom
topolarity:ct/fix-JL-generated
Nov 24, 2025
Merged

[JuliaLowering] Fix handling of unnamed args in @generated functions#60226
topolarity merged 2 commits intoJuliaLang:masterfrom
topolarity:ct/fix-JL-generated

Conversation

@topolarity
Copy link
Copy Markdown
Member

This is required to get Dates pre-compiling with JuliaLowering.

@topolarity topolarity requested a review from mlechu November 24, 2025 14:42
@topolarity topolarity added compiler:lowering Syntax lowering (compiler front end, 2nd stage) bugfix This change fixes an existing bug and removed bugfix This change fixes an existing bug labels Nov 24, 2025
]
[K"call"
"svec"::K"core"
(n.name_val::K"Symbol"(n) for n in typevar_names)...
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need this for static parameters too? (Underscores are usable as static parameters, but is that even intended?)

Copy link
Copy Markdown
Member Author

@topolarity topolarity Nov 24, 2025

Choose a reason for hiding this comment

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

Good question! I'd say this is probably unintended:

julia> foo(x::_, y::_) where _ = 13
foo (generic function with 1 method)

julia> foo(1,2)
13

julia> foo(1,2.4)
ERROR: MethodError: no method matching foo(::Int64, ::Float64)
The function `foo` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  foo(::_, ::_) where _

that should probably be an error, just like foo(::_, ::_) = ... is

@topolarity topolarity merged commit 802f1df into JuliaLang:master Nov 24, 2025
8 checks passed
topolarity pushed a commit that referenced this pull request Nov 25, 2025
…60233)

Pass `expr_compat_mode` through to `GeneratedFunctionStub`.  You can get
surprisingly far into the stdlibs without testing this!

Also reduce the IR printing I mentioned being an issue in #60226, which
tests that we're keeping the whole green tree the same.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler:lowering Syntax lowering (compiler front end, 2nd stage)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants