A summary of four Project Amber mailing list discussions about pattern matching in Java (as of January 2021). Topics covered include: a new design document on pattern matching in the Java object model by Brian Goetz and Gavin Bierman; array patterns for matching and destructuring arrays; destructuring patterns in for-each loops and how variable declarations can be viewed as pattern matches; and the use of the diamond operator for generic type inference in type patterns. Also discusses the broader debate about releasing large language features incrementally versus keeping them in preview until the full picture is ready.

10m read timeFrom nipafx.dev
Post cover image
Table of contents
▚ Intro▚ Pattern Matching Docs▚ Array Patterns▚ Destructuring Patterns in For-Each Loops▚ Type Patterns and Generics▚ Outro

Sort: