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

Error in functor definition with where clause and newlines #58060

Open
AntonReinhard opened this issue Apr 10, 2025 · 0 comments
Open

Error in functor definition with where clause and newlines #58060

AntonReinhard opened this issue Apr 10, 2025 · 0 comments
Labels
parser Language parsing and surface syntax regression Regression in behavior compared to a previous version regression 1.12 Regression in the 1.12 release

Comments

@AntonReinhard
Copy link

When defining a functor in julia version 1.12, I get an error (depending on the formatting), while 1.11 and 1.10 work fine. MWE:

julia> function (
           a::Tuple{A}
       )() where {A<:Int64} end
ERROR: UndefVarError: `A` not defined in `Main`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
 [1] top-level scope
   @ REPL[1]:1

Putting it in one line works like normal, even with spaces. Just the newlines seem to break it.

julia> function (a::Tuple{A})() where {A<:Int64} end

julia> function ( a::Tuple{A} )() where {A<:Int64} end

1.12 versioninfo():

julia> versioninfo()
Julia Version 1.12.0-beta1
Commit c175ace780d (2025-04-02 11:19 UTC)
Build Info:
  Official https://julialang.org release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 24 × AMD Ryzen 9 7900X3D 12-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-18.1.7 (ORCJIT, znver4)
  GC: Built with stock GC
Threads: 1 default, 1 interactive, 1 GC (on 24 virtual cores)
@nsajko nsajko added parser Language parsing and surface syntax regression Regression in behavior compared to a previous version regression 1.12 Regression in the 1.12 release labels Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parser Language parsing and surface syntax regression Regression in behavior compared to a previous version regression 1.12 Regression in the 1.12 release
Projects
None yet
Development

No branches or pull requests

2 participants