Skip to content

Commit

Permalink
Merge pull request #399 from oscar-system/bl/safercast
Browse files Browse the repository at this point in the history
  • Loading branch information
benlorenz authored May 31, 2022
2 parents 9242f08 + f1de4ba commit 0a3773f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Polymake"
uuid = "d720cf60-89b5-51f5-aff5-213f193123e7"
repo = "https://github.com/oscar-system/Polymake.jl.git"
version = "0.7.2"
version = "0.8.0"

[deps]
BinaryWrappers = "f01c122e-0ea1-4f85-ad8f-907073ad7a9f"
Expand Down
8 changes: 6 additions & 2 deletions src/perlobj.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ function bigobject(fname::String; kwargsdata...)
end

function bigobject(fname::String, other::BigObject; kwargsdata...)
obj = BigObject(BigObjectType(fname), other; kwargsdata...)
return obj
type = BigObjectType(fname)
# use converting copy but make sure types are related
if _isa(other, type) || _isa(BigObject(type), bigobject_type(other))
return BigObject(type, other; kwargsdata...)
end
throw(ArgumentError("cannot copy-convert unrelated types: $(Polymake.type_name(other)) to $(Polymake.type_name(type))"))
end

function bigobject(fname::String, name::String; kwargsdata...)
Expand Down
1 change: 1 addition & 0 deletions test/perlobj.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
@test polytope.Polytope(c) isa Polymake.BigObject

@test_throws ErrorException Polymake.cast!(c,Polymake.BigObjectType("fan::PolyhedralFan"))
@test_throws ArgumentError fan.PolyhedralFan(c)
end
end

Expand Down

2 comments on commit 0a3773f

@benlorenz
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator: register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/61663

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.0 -m "<description of version>" 0a3773f1adfdc9a85259c4e5c8002ea29c7d2924
git push origin v0.8.0

Please sign in to comment.