swiftwasm / WebAPIKit

Access the DOM and other Web APIs from Swift! (Very much a WIP)
MIT License
63 stars 8 forks source link

Deal with “illegal static override” symbols #31

Closed j-f1 closed 1 year ago

j-f1 commented 2 years ago

They all look like they can be made into class methods, so I’m not sure why that isn’t the case.

https://github.com/swiftwasm/DOMKit/blob/271ef4156da79632e90ea6e41688394cdddea991/Sources/WebIDLToSwift/WebIDL%2BSwiftRepresentation.swift#L450-L455

https://github.com/swiftwasm/DOMKit/blob/271ef4156da79632e90ea6e41688394cdddea991/Sources/WebIDLToSwift/WebIDL%2BSwiftRepresentation.swift#L496-L501

j-f1 commented 1 year ago

Fixed in 493bf5d4afca704a9c27b25259c8b694de78b76e. I was just setting up the context incorrectly, so the methods were incorrectly declared as static rather than class. They‘re declared as class now. Also, I’ve had to manually patch a few that are overrides in JS (since only the first part of the name counts) but aren’t in Swift (since the parameter names/counts differ).