Skip to content

Incorrect else if condition coverage #62943

@hamishknight

Description

@hamishknight

For e.g:

func foo() {
  if .random() {
    ()
  } else if .random() {
    ()
  } else {
    ()
  }
}

the condition else if .random() is given the region 0, which is incorrect, it should be (0 - 1), i.e it's hit anytime the first if condition isn't true.

rdar://104078910

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.code coverageArea → source tooling: code coveragecompilerThe Swift compiler itselfif elseFeature → statements: 'if' statementssource toolingArea: IDE support, SourceKit, and other source toolingstatementsFeature: statementsswift 5.8unexpected behaviorBug: Unexpected behavior or incorrect output

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions