Skip to content

code_warntype doesn't document the optimize kwarg #48804

Open
@oxinabox

Description

@code_warntype takes an optimize argument that seems to default to false.
This is never mentioned in it's docstring, not the docsting for the function form.
You can see it clearly exists in the difference between the following two examples.

julia> @code_warntype (()->1+1)()
MethodInstance for (::var"#7#8")()
  from (::var"#7#8")() @ Main REPL[16]:1
Arguments
  #self#::Core.Const(var"#7#8"())
Body::Int64
1%1 = (1 + 1)::Core.Const(2)
└──      return %1


julia> @code_warntype optimize=true (()->1+1)()
MethodInstance for (::var"#9#10")()
  from (::var"#9#10")() @ Main REPL[17]:1
Arguments
  #self#::Core.Const(var"#9#10"())
Body::Int64
1return 2

I assume it is the same as the one which is documented for @code_typed

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions