Runtime crash: T
constraint ignored for any Alias<T>
when typealias Alias<T> = ProtoA & ProtoB<T>
#72390
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
crash
Bug: A crash, i.e., an abnormal termination of software
duplicate
Resolution: Duplicates another issue
existentials
Feature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased values
generics
Feature: generic declarations and types
parameterized protocols
Feature → protocol: protocols with primary associated types
protocol compositions
Feature → types: protocol composition types
run-time crash
Bug → crash: Swift code crashed during execution
swift 6.0
types
Feature: types
Description
No response
Reproduction
https://godbolt.org/z/754fnc3qY
Stack dump
Expected behavior
The code should not compile.
There should be an error emitted for type mismatch in:
Environment
swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Target: arm64-apple-macosx14.0
Additional information
For what its worth, this only happens when
typealias
is involved.Otherwise, there's an unrelated compilation error:
#63877 (comment) leads me to believe that this particular error should not actually exist,
and both
Alias<[String]>
andProtoA & ProtoB<[String]>
should be allowed and handled properly.The text was updated successfully, but these errors were encountered: