~/talk

Record Patterns - Going Beyond Records - A Deep Dive

Talkat EclipseCon 2023 · 2023-10-16..10-19· [java, compilers-and-language-design]
links:none on file
slides:none on file

Java 21 standardizes the Record Pattern feature and the companion Switch Pattern, demonstrates how compilers lower patterns to an invokedynamic type switch with a bootstrap array of concrete types, and shows deconstruction extracting record components (including nested records and inferred types). Concrete gotchas include dominating case order, no multi-case pattern lists, no fall-through, record patterns not allowed in for-each, and null handling wired through a match exception wrapper that uses record accessors under the hood.

AI-written summary · about

  1. 0:00Record patterns overview
  2. 1:31Records as constant classes
  3. 6:06Records for data modeling
  4. 7:58Switch statement limits
  5. 9:55Type switches bytecode
  6. 15:20When keyword in switches
  7. 20:42Switch pattern errors
  8. 23:23Sealed classes with records
  9. 27:26Record deconstruction patterns
  10. 29:12Exhaustive switch expressions
  11. 31:51Record pattern restrictions
  12. 32:54Record patterns in loops
  13. 33:39Null handling in records
  14. 36:32Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.