1110192d62
In order to handle variable patterns inside logical-or patterns, flow analysis will need to model the implicit temporary variables that represent the variables before they are joined to form the final variable value. This CL adds the necessary logic to model this: - `declaredVariablePattern` is now responsible for initializing the temporary variable (the client no longer needs to call `initialize` when analyzing a variable pattern). It returns an integer representing the implicit temporary variable. - A new API call, `assignMatchedPatternVariable` can be used by the client to transfer the variable from the implicit temporary variable to a user-accessible variable. For now, the shared analysis logic always calls this from `analyzeDeclaredVariablePattern`, after calling `declaredVariablePattern`. However, in the future, it will postpone the call until after these temporary variables are implicitly joined by logical-or patterns. Bug: https://github.com/dart-lang/sdk/issues/50419 Change-Id: I2b78a46c11d0d46c8e0a8691c2a2ce49dceb2a24 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279078 Commit-Queue: Paul Berry <paulberry@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>