ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.
When trying to generate an xcframework from the Swift runtime and using that in my application I bumped into some nasty errors:
/Users/martinvw/Library/Developer/Xcode/DerivedData/test-acqlbgtzsvmmgafvduarmjnwwrtr/Build/Products/Debug-iphonesimulator/Antlr4.framework/Modules/Antlr4.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:244:19: error: initializer does not override a designated initializer from its superclass
override public init()
~~~~~~~~ ^
/Users/martinvw/Library/Developer/Xcode/DerivedData/test-acqlbgtzsvmmgafvduarmjnwwrtr/Build/Products/Debug-iphonesimulator/Antlr4.framework/Modules/Antlr4.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:1089:31: error: initializer does not override a designated initializer from its superclass
convenience override public init(_ target: Antlr4.ATNState)
~~~~~~~~ ^
/Users/martinvw/Library/Developer/Xcode/DerivedData/test-acqlbgtzsvmmgafvduarmjnwwrtr/Build/Products/Debug-iphonesimulator/Antlr4.framework/Modules/Antlr4.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:1558:21: error: initializer does not override a designated initializer from its superclass
override public init()
~~~~~~~~ ^
/Users/martinvw/Library/Developer/Xcode/DerivedData/test-acqlbgtzsvmmgafvduarmjnwwrtr/Build/Products/Debug-iphonesimulator/Antlr4.framework/Modules/Antlr4.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:1684:19: error: initializer does not override a designated initializer from its superclass
override public init(_ target: Antlr4.ATNState)
~~~~~~~~ ^
/Users/martinvw/Library/Developer/Xcode/DerivedData/test-acqlbgtzsvmmgafvduarmjnwwrtr/Build/Products/Debug-iphonesimulator/CsdYaraIOS.framework/Modules/CsdYaraIOS.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:4:8: error: failed to load module 'Antlr4'
import Antlr4
doesn't have a public init, and so calling DisposeBag's init an override is incorrect from outside the module. However, I'm not sure we actually implement this correctly (where calling DisposeBag's init from a convenience initializer works without being able to see DisposeBase's init), so the broken interface is potentially protecting you from this issue.
And also:
tested serval libraries and found it pretty common to get an error:
correct: lottie-ios, SnapKit
got errors: Alamofire, SwiftyJSON, RxSwift
Here's a detail description to reproduce the errors:
So the init methods in the parent classes should also be public, I can/will create a PR for that when desired.
When trying to generate an xcframework from the Swift runtime and using that in my application I bumped into some nasty errors:
After a long search I ender up at: https://forums.swift.org/t/generated-swiftinterface-has-wrong-content/28543
Where the following message is the most relevant:
And also:
So the
init
methods in the parent classes should also be public, I can/will create a PR for that when desired.