[SR-9108] GSB drops requirements when processing superclass constrained type #51605
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
crash
Bug: A crash, i.e., an abnormal termination of software
optimized only
Flag: An issue whose reproduction requires optimized compilation
regression
swift 4.2
Environment
Mac Pro 2013, running macOS 10.13.6.
The swift compiler is the pre-built one from Xcode 10. I will attempt to build swift 4.2 from scratch and confirm that the issue still exists there, that it is not an "Apple" created issue.
It would be really good if someone can confirm if this is a bug in swift 4.2 compiled on a linux box.
Additional Detail from JIRA
md5: ebc0bd91af09edfda7c3156aa2734372
Issue Description:
A regression seems to have appeared in the optimisation pipeline for SIL.
I've got it down to a fairly minimal case...
Compiled with optimisation turned on, this will crash the compile in Xcode 10 [Apple Swift version 4.2 (swiftlang-1000.11.37.1 clang-1000.11.45.1)].
e.g.
...Xcode\ 10.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -O crashOptimiser.swift
If the initialiser is uncommented in AdjustedClass, it compiles fine.
With optimisations turned off it compiles and runs fine:
...Xcode\ 10.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc crashOptimiser.swift
This produces a working, simple program.
Also, I've tested the above command using the Xcode 9.4 version of swift [Apple Swift version 4.1.2 (swiftlang-902.0.54 clang-902.0.39.2)]
With that version, no crash is seen, even if optimisations are turned on, and even if the first initialiser in AdjustedClass is commented out, and the program runs fine and behaves as you would expect (the initialiser in the protocol extension is called).
The text was updated successfully, but these errors were encountered: