Skip to content

[SR-910] Type Int1 does not conform to protocol BooleanType  #43522

@josephlord

Description

@josephlord
Previous ID SR-910
Radar rdar://problem/33768959
Original Reporter @josephlord
Type Bug
Status Closed
Resolution Done

Attachment: Download

Environment

Xcode Version 7.3 beta (7D162j) - default toolchain

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, TypeChecker
Assignee mkchoi212 (JIRA)
Priority Medium

md5: 0f2b3b38cf100f64f01b9de240c15935

Issue Description:

[NOTE - See comment below. The .whiteColor and .blackColor methods were not actually being called as they should have been. The error message is still very bad though so I'm not resolving the issue.]

Compile error "Type 'Int1' does not conform to protocol 'BooleanType'" is occurring when I don't think it should. First encountered in application code but the below example has the same error in the Playground.

This isn't quite the minimal sample where this is happening but it is getting close. The error does disappear at some point in simplification even when I don't think that the types should fundamentally change.

class PLStandardTableViewCell {
    var title: UILabel? = nil
    
    func setSelected(selected: Bool) {
        title?.textColor = selected ? .whiteColor : .blackColor
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of Implementationtype checkerArea → compiler: Semantic analysis

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions