Skip to content

Allow UnionAll types in rettypes for improved interface compatibility#30

Merged
ChrisRackauckas merged 3 commits into
SciML:mainfrom
ChrisRackauckas-Claude:interface-check-20260107-150433
Jan 9, 2026
Merged

Allow UnionAll types in rettypes for improved interface compatibility#30
ChrisRackauckas merged 3 commits into
SciML:mainfrom
ChrisRackauckas-Claude:interface-check-20260107-150433

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Summary

  • 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
  • Added tests for BigFloat support and UnionAll return types

Background

The constructor previously restricted rettypes to Tuple{Vararg{DataType, K}}, which prevented using parametric types like JLArray{Float64} or AbstractArray{Float64} as return types. These are UnionAll types, not DataType.

The underlying FunctionWrappers.jl already supports these types, so this was an unnecessary restriction.

Changes

src/FunctionWrappersWrappers.jl:

  • Changed rettypes::Tuple{Vararg{DataType, K}} to rettypes::Tuple{Vararg{Type, K}}

test/runtests.jl:

  • Added test for BigFloat support (verifying arbitrary precision works)
  • Added test for UnionAll return types (testing AbstractArray{Float64})

Backwards Compatibility

This is fully backwards compatible since DataType <: Type, so all existing code continues to work.

Test plan

  • Existing tests pass
  • New BigFloat tests pass
  • New UnionAll return type tests pass

cc @ChrisRackauckas

🤖 Generated with Claude Code

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>
@ChrisRackauckas-Claude ChrisRackauckas-Claude force-pushed the interface-check-20260107-150433 branch from 4cf85b7 to ea94014 Compare January 9, 2026 11:38
@ChrisRackauckas ChrisRackauckas merged commit 0ef2c54 into SciML:main Jan 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants