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

Formal protocol checking should use type compatibility, not a hard check #432

Closed
ronaldoussoren opened this issue Feb 8, 2022 · 0 comments

Comments

@ronaldoussoren
Copy link
Owner

The script below defines a dummy class implementing a Cocoa protocol:

import Cocoa
import objc

class AppDelegate( Cocoa.NSObject, protocols=[objc.protocolNamed("NSApplicationDelegate")]):
    pass

This currently fails due to the base class not passing the protocol conformance check. This can be fixed by treating bool/NSBOOL/char compatible. Same for long and long long (assuming 64-bit). Needs tests as well.

Error:

Traceback (most recent call last):
  File "bug.py", line 4, in <module>
    class AppDelegate( Cocoa.NSObject, protocols=[objc.protocolNamed("NSApplicationDelegate")]):
TypeError: class AppDelegate does not correctly implement protocol NSApplicationDelegate: the signature for method 'respondsToSelector:' is c@:: instead of B24@0:8:16
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

No branches or pull requests

1 participant