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

promote rule fails in quaternion.jl #1079

Closed
JeffreySarnoff opened this issue Jul 23, 2012 · 4 comments
Closed

promote rule fails in quaternion.jl #1079

JeffreySarnoff opened this issue Jul 23, 2012 · 4 comments

Comments

@JeffreySarnoff
Copy link
Contributor

julia> promote_rule{T,S}(::Type{Real{T}}, ::Type{Quaternion{S}}) =
Quaternion{promote_type(T,S)}
too many parameters for type Real
in anonymous at no file

@pao
Copy link
Member

pao commented Jul 23, 2012

Where is quaternion.jl? Doesn't look to be in the source tree.

At any rate, Real is not a parameterized type, it's an abstract type. Do you mean to instead define:

promote_rule{T<:Real, S}(::Type{T}, ::Type{Quaternion{S}}) = Quaternion{promote_type(T, S)}

@JeffreySarnoff
Copy link
Contributor Author

./examples/quaternion.jl
(I am just copying what was in the file)

On Mon, Jul 23, 2012 at 3:17 AM, pao <
[email protected]

wrote:

Where is quaternion.jl? Doesn't look to be in the source tree.

At any rate, Real is not a parameterized type, it's an abstract type. Do
you mean to instead define:

promote_rule{T<:Real, S}(::Type{T}, ::Type{Quaternion{S}}) =
Quaternion{promote_type(T, S)}

Reply to this email directly or view it on GitHub:
#1079 (comment)

@JeffreySarnoff
Copy link
Contributor Author

when I tried to load it, that line caused the error reported

julia> load("./examples/quaternion.jl")
too many parameters for type Real
in anonymous at no file
in load at util.jl:233
in load at util.jl:245
at /home/jas/Public/julia/examples/quaternion.jl:20
in load at util.jl:256

On Mon, Jul 23, 2012 at 3:27 AM, Jeffrey Sarnoff
[email protected]:

./examples/quaternion.jl
(I am just copying what was in the file)

On Mon, Jul 23, 2012 at 3:17 AM, pao <
[email protected]

wrote:

Where is quaternion.jl? Doesn't look to be in the source tree.

At any rate, Real is not a parameterized type, it's an abstract type. Do
you mean to instead define:

promote_rule{T<:Real, S}(::Type{T}, ::Type{Quaternion{S}}) =
Quaternion{promote_type(T, S)}

Reply to this email directly or view it on GitHub:
#1079 (comment)

@JeffBezanson
Copy link
Member

I think that code is pretty old and just needs to be updated. Real does not have a parameter anymore.

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

3 participants