Skip to content

Analyzer: no error assigning to a final local via for in loop #35508

Closed
@MichaelRFairhurst

Description

@MichaelRFairhurst

Discovered seemingly on accident by language_2/void/void_type_usage_test/final_local_for_in2

  final Object x = null;                                                         
  for(x in [1, 2]) {}

This doesn't show any errors but of course should. x is final so it cannot be set to 1 and 2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onlegacy-area-analyzerUse area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions