Skip to content

Commit 7aa9b89

Browse files
committed
Complex doesn't convert to Float
1 parent 287cce3 commit 7aa9b89

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/testsuite/construction.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,13 @@ function iterator_constructors(Typ)
173173
for T in supported_eltypes()
174174
@test Typ(Fill(T(0), (10,))) == zeros(Typ{T}, 10)
175175
@test Typ(Fill(T(0), (10, 10))) == zeros(Typ{T}, 10, 10)
176-
x = Typ{Float32}(Fill(T(0), (10, 10)))
177-
eltype(x) == Float32
178-
179-
@test Typ(Eye{T}((10, 10))) == eye(Typ{T}, 10, 10)
180-
x = Typ{Float32}(Eye{T}((10, 10)))
181-
@test eltype(x) == Float32
176+
if T <: Real
177+
x = Typ{Float32}(Fill(T(0), (10, 10)))
178+
@test eltype(x) == Float32
179+
@test Typ(Eye{T}((10, 10))) == eye(Typ{T}, 10, 10)
180+
x = Typ{Float32}(Eye{T}((10, 10)))
181+
@test eltype(x) == Float32
182+
end
182183
end
183184
end
184185
end

0 commit comments

Comments
 (0)