The following code compiles fine on macOS with Xcode 15.0.
class X {
func test1(_ o: AnyObject) {}
func test12() { test1(Self.self) }
}
But it will emit a fatalError when compiling on Linux.
swift build
Building for debugging...
/Users/kyle/Downloads/DemoKit/Sources/DemoKit/DemoKit.swift:9:27: error: argument type 'Self.Type' expected to be an instance of a class or class-constrained type
func test12() { test1(Self.self) }
^
error: fatalError
swift --version
Swift version 5.9.2 (swift-5.9.2-RELEASE)
Target: aarch64-unknown-linux-gnu
Anyone knows how to fix the issue?
Related Build Error Log
Related post: