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

cannot construct nested lists #75

Open
chfin opened this issue Jan 14, 2018 · 1 comment
Open

cannot construct nested lists #75

chfin opened this issue Jan 14, 2018 · 1 comment

Comments

@chfin
Copy link
Contributor

chfin commented Jan 14, 2018

The following fails:

julia> list(list(1), list(1))

with

ERROR: MethodError: colon(::Lazy.LinkedList, ::Lazy.LinkedList) is ambiguous. Candidates:
  colon(x, xs::Lazy.List) in Lazy at /home/chfin/.julia/v0.6/Lazy/src/Lazy.jl:62
  colon(start::T, stop::T) where T in Base at range.jl:9
Possible fix, define
  colon(::T<:Lazy.List, ::T<:Lazy.List)
Stacktrace:
 [1] list(::Lazy.LinkedList, ::Lazy.LinkedList, ::Vararg{Lazy.LinkedList,N} where N) at /home/chfin/.julia/v0.6/Lazy/src/Lazy.jl:66
 [2] macro expansion at ./REPL.jl:97 [inlined]
 [3] (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:73

I think the problem is that in the nested case the arguments of the colon operator are both lists, so method from Base applies as well. As the error message suggests, an explicit method for this case should fix the problem.

@chfin
Copy link
Contributor Author

chfin commented Jan 14, 2018

The suggested fix is applied in #76.

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

No branches or pull requests

1 participant