-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
SILGenArea → compiler: The SIL generation stageArea → compiler: The SIL generation stagebugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwaredefault argumentsFeature: default arguments for value parametersFeature: default arguments for value parametersexistentialsFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuesFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuesfunction parametersFeature → declarations: function parametersFeature → declarations: function parametersgenericsFeature: generic declarations and typesFeature: generic declarations and typesimplicit existential openingFeature → existentials: implicit opening of existentials when passed to parameters of generic typeFeature → existentials: implicit opening of existentials when passed to parameters of generic typeinoutFeature → types: `inout` typesFeature → types: `inout` typesswift 5.9typesFeature: typesFeature: typesvariadic parametersFeature → declarations → function parameters: Variadic function parametersFeature → declarations → function parameters: Variadic function parameters
Description
Description
The Swift compiler crashes when emitting SIL for the following Swift code:
// Logger.swift
final class StdoutOutputStream: TextOutputStream {
func write(_ string: String) {}
}
final class DefaultLogger {
private var stdout: TextOutputStream
init(stdout: TextOutputStream = StdoutOutputStream()) {
self.stdout = stdout
}
func logDebug(_ message: String) {
print(message, to: &self.stdout)
}
}
Steps to reproduce
swiftc Logger.swift
Expected behavior
Should compile successfully.
Environment
- Swift compiler version info: swift-driver version: 1.62.15 Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51), Target: arm64-apple-macosx13.0
- Xcode version info: Xcode 14.2, Build version 14C18
- Deployment target: macOS 13.2.1
oO0oO0oO0o0o00
Metadata
Metadata
Assignees
Labels
SILGenArea → compiler: The SIL generation stageArea → compiler: The SIL generation stagebugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwaredefault argumentsFeature: default arguments for value parametersFeature: default arguments for value parametersexistentialsFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuesFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuesfunction parametersFeature → declarations: function parametersFeature → declarations: function parametersgenericsFeature: generic declarations and typesFeature: generic declarations and typesimplicit existential openingFeature → existentials: implicit opening of existentials when passed to parameters of generic typeFeature → existentials: implicit opening of existentials when passed to parameters of generic typeinoutFeature → types: `inout` typesFeature → types: `inout` typesswift 5.9typesFeature: typesFeature: typesvariadic parametersFeature → declarations → function parameters: Variadic function parametersFeature → declarations → function parameters: Variadic function parameters