Allow UnionAll types in rettypes for improved interface compatibility#30
Merged
ChrisRackauckas merged 3 commits intoJan 9, 2026
Conversation
Changed `rettypes` parameter type constraint from `Tuple{Vararg{DataType, K}}`
to `Tuple{Vararg{Type, K}}` to allow UnionAll types like `AbstractArray{Float64}`
or `JLArray{Float64}` as return types.
This is backwards compatible since `DataType <: Type`, so all existing code
continues to work. The underlying FunctionWrappers.jl already supports these
types.
Added tests for:
- BigFloat support (verifying arbitrary precision works)
- UnionAll return types (testing AbstractArray{Float64})
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
4cf85b7 to
ea94014
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rettypesparameter type constraint fromTuple{Vararg{DataType, K}}toTuple{Vararg{Type, K}}to allow UnionAll types likeAbstractArray{Float64}orJLArray{Float64}as return typesBackground
The constructor previously restricted
rettypestoTuple{Vararg{DataType, K}}, which prevented using parametric types likeJLArray{Float64}orAbstractArray{Float64}as return types. These areUnionAlltypes, notDataType.The underlying FunctionWrappers.jl already supports these types, so this was an unnecessary restriction.
Changes
src/FunctionWrappersWrappers.jl:
rettypes::Tuple{Vararg{DataType, K}}torettypes::Tuple{Vararg{Type, K}}test/runtests.jl:
Backwards Compatibility
This is fully backwards compatible since
DataType <: Type, so all existing code continues to work.Test plan
cc @ChrisRackauckas
🤖 Generated with Claude Code