Skip to content

Commit 2536759

Browse files
authored
fix for working in --compiled-modules=no mode (#24)
1 parent dc9de95 commit 2536759

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/indexing.jl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@ _totally_linear(inds::Type{Int}...) = true
3535
_totally_linear(inds::Type{Colon}...) = true
3636
_totally_linear(i1::Type{Colon}, inds...) = _totally_linear(inds...)
3737

38+
function new_out_size_nongen(::Type{Size}, inds...) where Size
39+
os = []
40+
map(Size.parameters, inds) do s, i
41+
if i == Int
42+
elseif i <: StaticVector
43+
push!(os, i.parameters[1].parameters[1])
44+
elseif i == Colon
45+
push!(os, s)
46+
else
47+
error("Unknown index type: $i")
48+
end
49+
end
50+
return tuple(os...)
51+
end
52+
3853
"""
3954
_get_linear_inds(S, inds...)
4055
@@ -122,21 +137,6 @@ end
122137
end
123138
end
124139

125-
function new_out_size_nongen(::Type{Size}, inds...) where Size
126-
os = []
127-
map(Size.parameters, inds) do s, i
128-
if i == Int
129-
elseif i <: StaticVector
130-
push!(os, i.parameters[1].parameters[1])
131-
elseif i == Colon
132-
push!(os, s)
133-
else
134-
error("Unknown index type: $i")
135-
end
136-
end
137-
return tuple(os...)
138-
end
139-
140140
function new_out_size(S::Type{Size}, inds::StaticArrays.StaticIndexing...) where Size
141141
return new_out_size(S, map(StaticArrays.unwrap, inds)...)
142142
end

0 commit comments

Comments
 (0)