Skip to content

[SR-8867] no unused constant warning if local function follows #51373

@mattneub

Description

@mattneub
Previous ID SR-8867
Radar None
Original Reporter @mattneub
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, DiagnosticsQoI
Assignee None
Priority Medium

md5: 11e0a5dbc64b0db877509024dc5754de

Issue Description:

This yields a nice warning about the unused constant:

    func test() {
        let x = 1 // warning
    }

This doesn't:

    func test() {
        let x = 1 // no warning
        func inner() {
        }
    }

The local function seems to make the compiler's analysis-foo go away.

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