jw3126 / Setfield.jl

Update deeply nested immutable structs.
Other
167 stars 17 forks source link

constructor_of(T::UnionAll) #26

Closed jw3126 closed 6 years ago

jw3126 commented 6 years ago

https://github.com/jw3126/Setfield.jl/blob/940d72bccef97a47128a9ced3335b0c83d3a089e/src/lens.jl#L112 @tkf I would like to add a testcase for this, can you give an example, where this is needed?

tkf commented 6 years ago

It was required for something like constructor_of(Vector) == Array. I copied that from my other code. But in our usage, there is no chance that a type with unbound type parameters (i.e., UnionAll) is passed to constructor_of since it is typeof an instance (No object can do typeof(...) == UnionAll, right?). I think we can remove it.

jw3126 commented 6 years ago

Okay thanks for explaining and solving this!