Scala 3.8.4

Last reviewed Sep 5, 2026

Export as PDF

Prompt Details

Prompt Composition

2prompts
  1. Java 25113 lines · 2.8K tokens
  2. Scala 3.8.456 lines · 1.8K tokens
Total169 lines · 4.7K tokens

CWE Coverage

  • 20
  • 22
  • 59
  • 78
  • 79
  • 88
  • 89
  • 95
  • 117
  • 190
  • 201
  • 208
  • 209
  • 214
  • 295
  • 297
  • 306
  • 323
  • 327
  • 338
  • 347
  • 362
  • 367
  • 378
  • 427
  • 470
  • 471
  • 476
  • 494
  • 502
  • 532
  • 611
  • 653
  • 674
  • 681
  • 732
  • 749
  • 770
  • 772
  • 776
  • 789
  • 807
  • 863
  • 915
  • 916
  • 918
  • 922
  • 942
  • 1333

Prompt Preview

Apply the Java 25 prompt first. These rules cover Scala 3.8.4 types, metaprogramming, Java interop, concurrency, parsing, processes, and artifacts.

Types and domain state

  • Model trusted identities, validated input, money, paths, and authorization decisions as distinct opaque or value types.
  • Use enums and sealed hierarchies for closed states and handle every case explicitly.
  • Compile trust-boundary modules with -Wsafe-init, -deprecation, and -feature, plus -Werror or -Wconf rules that turn reviewed warning categories into errors. Do not use asInstanceOf or @unchecked on values that cross a trust boundary or to silence type-test and exhaustivity warnings.
  • Enable the experimental -Yexplicit-nulls where dependencies allow. Java members then get flexible types that still permit member selection, so ascribe their results as T | Null or compile with -Yno-flexible-types, and narrow them with a stable null check rather than .nn or unsafeNulls.
  • Import reflectiveSelectable only where the receiver's runtime class is trusted, because a structural call reflectively invokes whatever public member with that name and signature the object's class has.
  • Do not expose constructors or copy paths that let callers create an invalid security-sensitive value.

Parsing and dynamic behavior

  • Parse external data with schema-aware decoders and reject unknown fields, duplicates, excessive nesting, and invalid variants.
  • Never compile, interpret, reflectively load, or interpolate attacker-controlled Scala source or expressions.
  • Treat s, f, and raw