Files
swift-mirror/validation-test/compiler_crashers_2_fixed/issue-71921.swift
Slava Pestov e4d6108e11 SIL: Fix lowering for 'var's whose types contain local archetypes
A mutable 'var' becomes a SILBoxType, and we need to plumb the
correct generic signature through here too.

Fixes https://github.com/apple/swift/issues/71921.
2024-06-18 11:45:41 -04:00

22 lines
490 B
Swift

// RUN: %target-swift-frontend -emit-ir %s -disable-availability-checking
public protocol Signal {
mutating func process() -> Float
}
public struct Mixer<each Source: Signal> {
public var sources: (repeat each Source)
public mutating func process() -> Float {
var result: Float = 0
self.sources = (repeat ({
var signal = $0
result += signal.process()
return signal
}(each sources)))
return result
}
}