8da75ede06
Patterns may need to be visited twice during analysis: once to determine a type schema, and a second type to resolve the pattern match. Previously, the shared TypeAnalyzer had just a single `dispatchPattern` method, so it had to create temporary objects to record the structure of the patterns between the two visits. Now, there are two dispatch methods: `dispatchPatternSchema` and `dispatchPattern`. This avoids the creation of a bunch of temporary objects and makes the design much simpler. (Based on an idea from Brian Wilkerson) Change-Id: If10b6b7fb578594c3f660baa55d7e28123652638 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260282 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Paul Berry <paulberry@google.com>