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
Xcode 11.2.1
Swift 5 or Swift 4.2
Optimization Level
Debug: -Onone
Release: -Osize
Additional Detail from JIRA
Votes
1
Component/s
Compiler
Labels
Bug
Assignee
None
Priority
Medium
md5: 2287c0b1c6f1f2b96e703e1408ce4835
Issue Description:
Hi, the below code result is different if it runs in Debug build configuration and Release build configuration.
classViewController:UIViewController{overridefunc viewDidLoad(){
super.viewDidLoad()// Do any additional setup after loading the view.
Maker<Child>.hello()}}classGrandFather{requiredinit(){print("GrandFather init")}classfunc instance()->GrandFather{print("should be overridden by subclass")returnself.init()}}classParent:GrandFather{requiredinit(){
super.init()print("Parent init")}overrideclassfunc instance()->Parent{returnself.init()}}classChild:Parent{requiredinit(){
super.init()print("Child init")}}classMaker<ModelClass:GrandFather>{staticfunc hello(){print(ModelClass.instance())}}
If I run it under Debug configuration, I get this:
Environment
Xcode 11.2.1
Swift 5 or Swift 4.2
Optimization Level
Debug: -Onone
Release: -Osize
Additional Detail from JIRA
md5: 2287c0b1c6f1f2b96e703e1408ce4835
Issue Description:
Hi, the below code result is different if it runs in Debug build configuration and Release build configuration.
If I run it under Debug configuration, I get this:
But, if Release configuration, the result is:
I don't know why Maker.hello() get the different instance types?
The text was updated successfully, but these errors were encountered: