Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove asserts from precompile #23

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GridLayoutBase"
uuid = "3955a311-db13-416c-9275-1d80ed98e5e9"
authors = ["Julius Krumbiegel"]
version = "0.4.1"
version = "0.4.2"

[deps]
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
Expand Down
70 changes: 35 additions & 35 deletions src/precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,59 +4,59 @@ const Emptykwargs = Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(

function _precompile_()
ccall(:jl_generating_output, Cint, ()) == 1 || return nothing
@assert precompile(BBox, (Float32, Float32, Float64, Float64))
precompile(BBox, (Float32, Float32, Float64, Float64))

@assert precompile(GridLayout, (Int, Int))
@assert precompile(GridLayout, (GridLayoutSpec,))
@assert precompile(Core.kwfunc(GridLayout), (NamedTuple{(:bbox,), Tuple{Observable{IRect2D}}}, Type{GridLayout}))
@assert precompile(Core.kwfunc(GridLayout), (NamedTuple{(:bbox,), Tuple{FRect2D}}, Type{GridLayout}))
precompile(GridLayout, (Int, Int))
precompile(GridLayout, (GridLayoutSpec,))
precompile(Core.kwfunc(GridLayout), (NamedTuple{(:bbox,), Tuple{Observable{IRect2D}}}, Type{GridLayout}))
precompile(Core.kwfunc(GridLayout), (NamedTuple{(:bbox,), Tuple{FRect2D}}, Type{GridLayout}))
# Also precompile `GridLayout(bbox = bbox, alignmode = al)` and the keyword body method
fbody = isdefined(Base, :bodyfunction) ? Base.bodyfunction(which(GridLayout, (Int, Int))) : nothing
for Al in (Inside, Outside, Mixed)
@assert precompile(Core.kwfunc(GridLayout), (NamedTuple{(:bbox, :alignmode), Tuple{FRect2D, Al}}, Type{GridLayout}))
@assert precompile(Core.kwfunc(GridLayout), (NamedTuple{(:bbox, :alignmode), Tuple{Observable{FRect2D}, Al}}, Type{GridLayout}))
@assert precompile(Core.kwfunc(GridLayout), (NamedTuple{(:bbox, :alignmode), Tuple{NTuple{4,Int}, Al}}, Type{GridLayout}))
precompile(Core.kwfunc(GridLayout), (NamedTuple{(:bbox, :alignmode), Tuple{FRect2D, Al}}, Type{GridLayout}))
precompile(Core.kwfunc(GridLayout), (NamedTuple{(:bbox, :alignmode), Tuple{Observable{FRect2D}, Al}}, Type{GridLayout}))
precompile(Core.kwfunc(GridLayout), (NamedTuple{(:bbox, :alignmode), Tuple{NTuple{4,Int}, Al}}, Type{GridLayout}))
if fbody !== nothing
@assert precompile(fbody, (Nothing, Nothing, Nothing, Nothing, Al, Tuple{Bool, Bool}, FRect2D, Auto, Auto, Bool, Bool, Symbol, Symbol, Float64, Float64, Emptykwargs, Type{GridLayout}, Int, Int))
precompile(fbody, (Nothing, Nothing, Nothing, Nothing, Al, Tuple{Bool, Bool}, FRect2D, Auto, Auto, Bool, Bool, Symbol, Symbol, Float64, Float64, Emptykwargs, Type{GridLayout}, Int, Int))
end
end
@assert precompile(Core.kwfunc(GridLayout), (NamedTuple{(:colsizes, :rowsizes), Tuple{Fixed, Relative}}, Type{GridLayout}, Int, Int))
@assert precompile(Core.kwfunc(GridLayout), (NamedTuple{(:addedcolgaps,), Tuple{Vector{Fixed}}}, Type{GridLayout}, Int, Int))
precompile(Core.kwfunc(GridLayout), (NamedTuple{(:colsizes, :rowsizes), Tuple{Fixed, Relative}}, Type{GridLayout}, Int, Int))
precompile(Core.kwfunc(GridLayout), (NamedTuple{(:addedcolgaps,), Tuple{Vector{Fixed}}}, Type{GridLayout}, Int, Int))

@assert precompile(Core.kwfunc(Mixed), (NamedTuple{(:left, :top), Tuple{Int, Int}}, Type{Mixed}))
precompile(Core.kwfunc(Mixed), (NamedTuple{(:left, :top), Tuple{Int, Int}}, Type{Mixed}))
for T in (Int, Float32)
@assert precompile(Outside, (T,))
@assert precompile(Outside, (T,T,T,T))
precompile(Outside, (T,))
precompile(Outside, (T,T,T,T))
end
@assert precompile(align_to_bbox!, (GridLayout, FRect2D))
@assert precompile(update_gl!, (GridLayout,))
precompile(align_to_bbox!, (GridLayout, FRect2D))
precompile(update_gl!, (GridLayout,))
for I in subtypes(Indexables), J in subtypes(Indexables)
@assert precompile(setindex!, (GridLayout, UnitRange{Int}, I, J))
@assert precompile(setindex!, (GridLayout, Any, I, J))
precompile(setindex!, (GridLayout, UnitRange{Int}, I, J))
precompile(setindex!, (GridLayout, Any, I, J))
end
@assert precompile(insertrows!, (GridLayout, Int, Int))
@assert precompile(insertcols!, (GridLayout, Int, Int))
@assert precompile(gridnest!, (GridLayout, UnitRange{Int}, UnitRange{Int}))
@assert precompile(add_to_gridlayout!, (GridLayout, GridContent{GridLayout, GridLayout}))
@assert precompile(connect_layoutobservables!, (GridContent{GridLayout, GridLayout},))
@assert precompile(trim!, (GridLayout,))
@assert precompile(sizeobservable!, (Observable{Any}, Observable{Any}))
@assert precompile(_reportedsizeobservable, (Tuple{SizeAttribute,SizeAttribute}, Tuple{AutoSize,AutoSize}, AlignMode, RectSides{Float32}, Tuple{Bool,Bool}))
precompile(insertrows!, (GridLayout, Int, Int))
precompile(insertcols!, (GridLayout, Int, Int))
precompile(gridnest!, (GridLayout, UnitRange{Int}, UnitRange{Int}))
precompile(add_to_gridlayout!, (GridLayout, GridContent{GridLayout, GridLayout}))
precompile(connect_layoutobservables!, (GridContent{GridLayout, GridLayout},))
precompile(trim!, (GridLayout,))
precompile(sizeobservable!, (Observable{Any}, Observable{Any}))
precompile(_reportedsizeobservable, (Tuple{SizeAttribute,SizeAttribute}, Tuple{AutoSize,AutoSize}, AlignMode, RectSides{Float32}, Tuple{Bool,Bool}))
for T in subtypes(Side)
@assert precompile(bbox_for_solving_from_side, (RowCols{Vector{Float64}}, FRect2D, RowCols{Int}, T))
precompile(bbox_for_solving_from_side, (RowCols{Vector{Float64}}, FRect2D, RowCols{Int}, T))
end
for S in (Left, Right, Top, Bottom)
@assert precompile(protrusion, (GridContent{GridLayout,GridLayout}, S))
precompile(protrusion, (GridContent{GridLayout,GridLayout}, S))
end
@assert precompile(suggestedbboxobservable, (GridLayout,))
precompile(suggestedbboxobservable, (GridLayout,))
for VC in (Vector{Auto}, Vector{GapSize}, Vector{Fixed}, Vector{Relative}, Vector{ContentSize})
@assert precompile(convert_contentsizes, (Int, VC))
@assert precompile(==, (VC, VC))
precompile(convert_contentsizes, (Int, VC))
precompile(==, (VC, VC))
end
@assert precompile(contents, (GridLayout,))
@assert precompile(filterenum, (Function, Type, Vector{ContentSize}))
@assert precompile(zcumsum, (Vector{Float64},))
precompile(contents, (GridLayout,))
precompile(filterenum, (Function, Type, Vector{ContentSize}))
precompile(zcumsum, (Vector{Float64},))

# These don't work completely but they have partial success
@assert precompile(repr, (MIME{Symbol("text/plain")}, GridLayout))
precompile(repr, (MIME{Symbol("text/plain")}, GridLayout))
end