You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SR-5499 Incorrect dynamic dispatch behaviour for nested class overridden across modules when using whole module optimization.
Issue Description:
Suppose in an external module we have these defs:
public struct Woof {
open class Qux {
open var name: String? {
return nil
}
public func printName() {
print(name ?? "no name")
}
public init() {}
}
}
And then in the main module we have this:
class Foo: Woof.Qux {
override var name: String {
return "zorg"
}
}
let test = Foo()
test.printName()
Then if run with a release build config, we get "no name".
We can make it print "zorg" using any of the following changes:
Turn off "whole module optimization" for the external module.
Make Qux a non-nested type by moving it out of Woof.
Put all the code in the same module.
The text was updated successfully, but these errors were encountered:
Environment
Xcode Version 8.3.3 (8E3004b) , Swift 3
Additional Detail from JIRA
md5: 2d63037afdd34c62be4ebd4ea56801c8
duplicates:
Issue Description:
Suppose in an external module we have these defs:
And then in the main module we have this:
Then if run with a release build config, we get "no name".
We can make it print "zorg" using any of the following changes:
Turn off "whole module optimization" for the external module.
Make Qux a non-nested type by moving it out of Woof.
Put all the code in the same module.
The text was updated successfully, but these errors were encountered: