Skip to content

[SR-14932] Emit warning or error on mutually recursive initialization of static variables #57274

@typesanitizer

Description

@typesanitizer
Previous ID SR-14932
Radar rdar://problem/80820297
Original Reporter @typesanitizer
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement
Assignee None
Priority Medium

md5: 36faab10dcbb62f023ce9867cbdc0585

Issue Description:

struct S {
    static var x: Int = y
    static var y: Int = x
}
print(S.x)

With Xcode 13 beta 2, this crashes at runtime without any warnings. IMO it should emit a warning or be an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions