Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Return type declarations are not parsed correctly #55

Closed
KristofferC opened this issue Jul 23, 2016 · 1 comment · May be fixed by #67
Closed

Return type declarations are not parsed correctly #55

KristofferC opened this issue Jul 23, 2016 · 1 comment · May be fixed by #67

Comments

@KristofferC
Copy link
Member

KristofferC commented Jul 23, 2016

julia> import JuliaParser.Parser

julia> src = """
       function f(x)::Float64
           return x
       end
       """;

julia> parse(src)
:(function f(x)::Float64 # none, line 2:
        return x
    end)

julia> JuliaParser.Parser.parse(src)
:(function f(x) # none, line 1:
        ::Float64 # none, line 2:
        return x
    end)

julia> eval(JuliaParser.Parser.parse(src))
f (generic function with 1 method)

julia> f(1.0)
ERROR: ArgumentError: typeassert: too few arguments (expected 2)
 in f(::Float64) at ./none:1
 in eval(::Module, ::Any) at ./boot.jl:234
 in macro expansion at ./REPL.jl:92 [inlined]
 in (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:46
@KristofferC
Copy link
Member Author

Package is abandoned

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant