File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,7 @@ Base.Broadcast.broadcastable(::Zero) = Ref(Zero())
148
148
Base. iterate (x:: Zero ) = (x, nothing )
149
149
Base. iterate (:: Zero , :: Any ) = nothing
150
150
151
+ Base. real (:: Zero ) = Zero ()
151
152
152
153
# ####
153
154
# #### `DNE`
@@ -189,6 +190,7 @@ Base.Broadcast.broadcastable(::One) = Ref(One())
189
190
Base. iterate (x:: One ) = (x, nothing )
190
191
Base. iterate (:: One , :: Any ) = nothing
191
192
193
+ Base. real (:: One ) = One ()
192
194
193
195
# ####
194
196
# #### `AbstractThunk
@@ -216,6 +218,8 @@ wirtinger_primal(::Union{AbstractThunk}) =
216
218
wirtinger_conjugate (:: Union{AbstractThunk} ) =
217
219
throw (ArgumentError (" `wirtinger_conjugate` is not defined for `AbstractThunk`. Call `unthunk` first." ))
218
220
221
+ Base. real (x:: AbstractThunk ) = real (x ())
222
+
219
223
# ####
220
224
# #### `Thunk`
221
225
# ####
Original file line number Diff line number Diff line change 102
102
@test refine_differential (typeof (1.0 + 1im ), g) === g
103
103
@test refine_differential (typeof ([1.0 + 1im ]), g) === g
104
104
105
- c isa Thunk && continue
106
105
@test refine_differential (typeof (1.2 ), g) == real (c)
107
106
@test refine_differential (typeof ([1.2 ]), g) == real (c)
108
107
end
You can’t perform that action at this time.
0 commit comments