Skip to content

Commit

Permalink
new inner constructor syntax ala JuliaLang#20308
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj committed Feb 10, 2017
1 parent 7629cde commit 8871684
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/dimensionful.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# represents a quantity in furlongs^p
immutable Furlong{p,T<:Number} <: Number
val::T
Furlong(v::Number) = new(v)
Furlong(x::Furlong{p}) = new(x.val)
Furlong{p,T}(v::Number) where {p,T} = new(v)
Furlong{p,T}(x::Furlong{p}) where {p,T} = new(x.val)
end
Furlong{T<:Number}(x::T) = Furlong{1,T}(x)
(::Type{T}){p,T}(x::Furlong{p,T}) = x.val
Expand Down

0 comments on commit 8871684

Please sign in to comment.