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
func zero()->Int{print("hello")return0}structX{vary=zero()init(y:Int){self.y = y
}}letx=X(y:10)// hello
This behavior does not occur with memberwise initializers because they are lowered differently, but user defined initializers all have this same behavior.
This is a somewhat complicated issue and I plan to write a much longer topic on the forums discussing this and getting some feedback there. I'll post the link here when I get done writing it.
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: db7359379f23291a48589aff8b172323
Issue Description:
During SE-0242 (https://forums.swift.org/t/se-0242-synthesize-default-values-for-the-memberwise-initializer/20618/1), there was discussion about how the compiler currently treats initializers for structs and classes.
This behavior does not occur with memberwise initializers because they are lowered differently, but user defined initializers all have this same behavior.
Accepting rationale stated that the core team felt this behavior was a bug
(https://forums.swift.org/t/se-0242-synthesize-default-values-for-the-memberwise-initializer/20618/98).
This is a somewhat complicated issue and I plan to write a much longer topic on the forums discussing this and getting some feedback there. I'll post the link here when I get done writing it.
The text was updated successfully, but these errors were encountered: