Skip to content

Add return type to signature #5

Description

@oxinabox

This is a follow up for once #1 is complete.
At least of of now it never generates the return type.

But it could, it would requires some inspecting of the Code Lowered.

julia> f(x)::Int = round(Int, x)
f (generic function with 1 method)

julia> meth = first(methods(f))
f(x) in Main at REPL[16]:1

julia> Base.uncompressed_ast(meth)
CodeInfo(
    @ REPL[16]:1 within `f'
1 ─ %1 = Main.Int
│   %2 = Main.round(Main.Int, x)
│   %3 = Base.convert(%1, %2)
│   %4 = Core.typeassert(%3, %1)
└──      return %4
)
``

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    signaturerelating to the signature function to get def from methods

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions