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 use of @nospecialize with default arguments #3464

Merged
merged 1 commit into from Aug 29, 2023
Merged

Conversation

odow
Copy link
Member

@odow odow commented Aug 28, 2023

This is my fault for not reading the docstring carefully. (Although it worked for Julia 1.6.2+, so I guess I never bumped into the problem.)

Here's the docstring, with the relevant sentence:

help?> @nospecialize
  @nospecialize

  Applied to a function argument name, ... When applied to an argument, the
  macro must wrap the entire argument expression, e.g., @nospecialize(x::Real)
  or @nospecialize(i::Integer...) rather than wrapping just the argument name.
  ...

The docstring also contains this example, which I failed to see:

  function example_function(x, @nospecialize(y = 1))
      ...
  end

Closes #3461

Although the previous syntax works for Julia 1.6.2+, it fails for
Julia v1.6.0 and v1.6.1.
@codecov
Copy link

codecov bot commented Aug 29, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (b3c6f9f) 98.00% compared to head (86a3c0c) 98.00%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3464   +/-   ##
=======================================
  Coverage   98.00%   98.00%           
=======================================
  Files          36       36           
  Lines        5069     5069           
=======================================
  Hits         4968     4968           
  Misses        101      101           
Files Changed Coverage Δ
src/JuMP.jl 94.87% <ø> (ø)
src/optimizer_interface.jl 96.89% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@odow odow merged commit a061d91 into master Aug 29, 2023
12 checks passed
@odow odow deleted the od/fix-nospecialize branch August 29, 2023 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

JuMP 1.14.0 fails to precompile on Julia 1.6.0/1
1 participant