On Friday, May 30, 2014 1:13:01 PM UTC-4, Steven G. Johnson wrote: > > typeof(($f)(one(A), one(T))) > > and then the Array should get the correct type for multiplication by > SIQuantities like 1Meter. Multiplying by an SIUnit object like Meter will > require https://github.com/loladiro/SIUnits.jl/issues/18 to be fixed. >
(Though this won't be quite right for cases like T=Real and one(T) returns 1 (Int). But that sort of subtlety can be dealt with to some degree, I think, by appropriate additional checks, e.g. checking T.abstract, and then running promote_type fallback code.)
