[SR-6035] After upgrade to swift 3. Struct assignment not working as expected when release build. #48592
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
optimized only
Flag: An issue whose reproduction requires optimized compilation
Environment
xcode 8.3.3/xcode 9
swift 3
Additional Detail from JIRA
md5: 9c72e63b3d8e38edf067e8064f9d14eb
Issue Description:
My project using swift 3 on xcode 8.3.3 and xcode 9.They have same problem.Before convert to swift 3, using swift 2.3.3 * xcode 8.2 is Ok.
Problem : one function return a struct , but the value of stuct is not expected ,both default value.
ps:using inout can solve problem, but i still want to know the real reason.
I write a simple demo code :
#0. Problem: testIp is default value..
some test I've tried :
build configuration : debug is ok ,release mode has problem.
release build , swift compiler optimization level:fast,whole module optimization has problem,others are ok.
#1. add a print statement in function , everything is ok.
#2. not impelement EncodingProtocol, everything is ok.
PS: Although demo code looks strange, but i think it is correct in grammar. it should work fine.....
The text was updated successfully, but these errors were encountered: