-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
availabilityThe @available attribute and availability checking in generalThe @available attribute and availability checking in generalbugA 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 itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of Implementationtype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis
Description
Describe the bug
No diagnostic is being emitted when base type for implicit init from literal expression is unavailable.
@available(*, unavailable)
struct S: ExpressibleByIntegerLiteral {
init(integerLiteral value: Int) {}
}
@available(*, unavailable)
typealias IntegerLiteralType = S
let i = 0 // implicit resolves to S(integerLiteral: 0) but S is unavailable so we should emit availability diagnosticSteps To Reproduce
Steps to reproduce the behavior:
- Try compile the snippet above
...
Expected behavior
Unavailable diagnostic should be emitted.
Environment (please fill out the following information)
- Xcode Version/Tag/Branch: main at 66f6769
Metadata
Metadata
Assignees
Labels
availabilityThe @available attribute and availability checking in generalThe @available attribute and availability checking in generalbugA 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 itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of Implementationtype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis