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

Stop @cxxdereference from messing up linenum information #382

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

omus
Copy link
Contributor

@omus omus commented Oct 18, 2023

Makes a minor modification to @cxxdeference to stop that macro from add in line number information which blocks convenient macros likes @which and @edit from working properly:

julia> using CxxWrap

julia> foo() = 1
foo (generic function with 1 method)

julia> @which foo()
foo()
     @ Main REPL[2]:1

julia> @cxxdereference foo() = 1
foo (generic function with 1 method)

julia> @which foo()
foo()
     @ Main ~/.julia/packages/CxxWrap/VnssN/src/CxxWrap.jl:846

julia> @macroexpand @cxxdereference foo() = 1
:(function foo(; )
      #= /Users/cvogt/.julia/packages/CxxWrap/VnssN/src/CxxWrap.jl:846 =#
      #= REPL[8]:1 =#
      1
  end)

With this PR:

julia> using CxxWrap

julia> @cxxdereference foo() = 1
foo (generic function with 1 method)

julia> @which foo()
foo()
     @ Main REPL[2]:1

@barche
Copy link
Collaborator

barche commented Oct 18, 2023

Thanks!

@barche barche merged commit a1e26aa into JuliaInterop:main Oct 18, 2023
9 checks passed
@omus omus deleted the cv/fix-cxxdereference-linenums branch October 18, 2023 23:02
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.

2 participants