Skip to content

Requirement machine internal error on simple recursive same-type requirement #70875

Open
@AnthonyLatsis

Description

@AnthonyLatsis

Description

No response

Reproduction

struct S<X, Y> {
  func foo() where (X, Y) == X {}
}
error: cannot build rewrite system for generic signature; concrete nesting limit exceeded [requirement_machine_completion_failed]
  func foo() where (X, Y) == X {}
             ^
note: failed rewrite rule is τ_0_0.[concrete: ((((((((((((((((((((((((((((((τ_0_0, τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1), τ_0_1)] => τ_0_0 [requirement_machine_completion_rule]
  func foo() where (X, Y) == X {}

Expected behavior

A regular error about the requirement being recursive and unsatisfiable.

Environment

Swift version 5.11-dev (LLVM 13124099c3f0229, Swift 6d66211)
Target: x86_64-apple-darwin23.0.0

Additional information

No response

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 Implementationgeneric constraintsFeature → generics: generic constraintsgenericsFeature: generic declarations and typesinternal errorBug: Internal errorswift 6.0type checkerArea → compiler: Semantic analysis

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions