-
Notifications
You must be signed in to change notification settings - Fork 8
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
Represent at least some union types as protocols #43
Comments
Some properties in generated code have a layer of indirection due to their use of `ReadonlyAttribute` and `ReadWriteAttribute`. There's little value in keeping these static subscripts around and introducing the indirection. Additionally, it makes makes some issues on property code hard to debug when attempting to change union types generation logic in my investigation of #43.
The particular case of I’ve pushed a small ergonomic update in 5cb70da and 6f039f2 that allows you to call |
Currently, WebGL 1.0, WebGL 2.0, and WebGPU can't be split into separate modules as targets, as
enum RenderingContext
wraps all available context types and needs to have all of them in scope.If
RenderingContext
were a protocol, we could declare it in some "base" module and moveGPUCanvasContext
,WebGLRenderingContext
, andWebGL2RenderingContext
to their own respective modules adding a conformance on them to that protocol.I also thought about subclassing, but that clearly won't work due to the lack of multiple class inheritance. These types already inherit from
JSBridgedClass
, and protocols are the suggested instruments of achieving multiple inheritance in Swift.The text was updated successfully, but these errors were encountered: