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

[SR-970] The type encoding for subscript methods on @objc classes is NULL #43582

Open
tjw opened this issue Mar 17, 2016 · 0 comments
Open

[SR-970] The type encoding for subscript methods on @objc classes is NULL #43582

tjw opened this issue Mar 17, 2016 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself IRGen LLVM IR generation

Comments

@tjw
Copy link
Contributor

tjw commented Mar 17, 2016

Previous ID SR-970
Radar None
Original Reporter @tjw
Type Bug

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, IRGen
Assignee None
Priority Medium

md5: af2286bc1ef40c275029860e0850cb51

Issue Description:

In an @objc class, if you implement subscript taking an Int or object, the Method that gets emitted has a NULL type encoding, which can cause crashes in code that is inspecting the runtime (debug-only in my case, but still annoying to track down and ideally the runtime data would at least have id/NSInteger-based key/return generic signatures.

Tested in swift-2.2-branch tip and in the 3/1 development snapshot.

See the attached sample, which produces:

method = 0x000000010b4a3178
method name = objectAtIndexedSubscript:
method types = 0x0000000000000000
method = 0x000000010b4a3190
method name = setObject:atIndexedSubscript:
method types = 0x0000000000000000
method = 0x000000010b4a31a8
method name = objectForKeyedSubscript:
method types = 0x0000000000000000
method = 0x000000010b4a31c0
method name = setObject:forKeyedSubscript:
method types = 0x0000000000000000
@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself IRGen LLVM IR generation
Projects
None yet
Development

No branches or pull requests

1 participant