Skip to content

Commit 9a12a46

Browse files
committed
allow fieldcount(T) == 0
1 parent fe250fe commit 9a12a46

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/array.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ end
4545
# these are stored with a selector at the end (handled by Julia).
4646
# 3. bitstype unions (`Union{Int, Float32}`, etc)
4747
# these are stored contiguously and require a selector array (handled by us)
48+
# As well as "mutable singleton" types like `Symbol` that use pointer-identity
4849
@inline function check_eltype(name, T)
49-
if !Base.allocatedinline(T)
50+
if !(Base.allocatedinline(T) || Base.datatype_fieldcount(T) == 0)
5051
explanation = explain_eltype(T)
5152
error("""
5253
$name only supports element types that are allocated inline.

0 commit comments

Comments
 (0)