Adapt to ObjectiveC.jl type model rework#776
Merged
Merged
Conversation
The Objective-C class hierarchy is no longer modeled via Julia's `<:`, so the
old `where {K<:ParentClass}` signatures (which used to dispatch over all of a
parent class's subclasses) only match the parent itself now. This commit
migrates those callers:
- Methods polymorphic over a parent class use `@objcdispatch` with `KindOf{T}`
arguments (MPSMatrixRandom encode!, MPSNDArrayMultiary/Unary/Binary encode!,
MPSUnaryImageKernel encode!, MTLCommandEncoder endEncoding!, MTLEvent
encode_signal!/encode_wait!).
- Where two `@objcdispatch` methods on different parents would generate
identical `(::Object, ...)` forwarders (Unary 2-arg vs Binary 2-arg, both
taking two MPSNDArrays), a single hand-written method on `::Object` branches
on `inherits_from` instead.
- `Base.copy(::MPSKernel)` and `Base.close(::MTLCommandEncoder)` stay manual
because the body needs `typeof(kernel)` to rebuild the return wrapper /
delegate to the right dispatched function.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2232fb2 to
241e8f0
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #776 +/- ##
==========================================
- Coverage 80.65% 80.52% -0.13%
==========================================
Files 61 61
Lines 2843 2845 +2
==========================================
- Hits 2293 2291 -2
- Misses 550 554 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
x-ref JuliaInterop/ObjectiveC.jl#63