Skip to content

[SR-10785] A single line code makes compiler fail #53175

@swift-ci

Description

@swift-ci
Previous ID SR-10785
Radar None
Original Reporter forucial (JIRA User)
Type Bug
Environment

OS: macOS 10.14.5

Xcode: 10.2.1

Swift: 5.0.1

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Performance, TypeChecker
Assignee None
Priority Medium

md5: 450b9b21145f78dc00ed0ceaf915f4c7

Issue Description:

if 0.1 * 5 == 0.1 + 0.1 + 0.1 + 0.1 + 0.1 { }

This code makes compiler refused to compile and report

"The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions"

However such code

if 0.1 * 4 == 0.1 + 0.1 + 0.1 + 0.1 { }

is accepted without any error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfperformancetype checkerArea → compiler: Semantic analysis

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions