diff --git a/changelogs/3.7.3-RC1.md b/changelogs/3.7.3-RC1.md
new file mode 100644
index 000000000000..25a2526d8e50
--- /dev/null
+++ b/changelogs/3.7.3-RC1.md
@@ -0,0 +1,224 @@
+# Release highlights
+
+- Standardize on `-Vprint:...` (still support `-Xprint:...` as alias) [#22828](https://github.com/scala/scala3/pull/22828)
+
+# Other changes and fixes
+
+## Desugaring
+
+- Fix #23224: Optimize simple tuple extraction [#23373](https://github.com/scala/scala3/pull/23373)
+
+## Enums
+
+- Make hashcode of enum items stable [#23218](https://github.com/scala/scala3/pull/23218)
+
+## Erasure
+
+- Replace erased class modifiers with Erased base traits [#23447](https://github.com/scala/scala3/pull/23447)
+- Bring back part of PruneErasedDefs [#23466](https://github.com/scala/scala3/pull/23466)
+
+## Experimental: Capture Checking
+
+- Fix parsing crash for update in later phases [#23390](https://github.com/scala/scala3/pull/23390)
+- Implement boxing for singleton type arguments [#23418](https://github.com/scala/scala3/pull/23418)
+- Expand Capability types also in arguments of Capability classes  [#23427](https://github.com/scala/scala3/pull/23427)
+- Adjustments to the capability trilogy [#23428](https://github.com/scala/scala3/pull/23428)
+- Set context owner to the method for `paramsToCap` [#23436](https://github.com/scala/scala3/pull/23436)
+- Flatten nested capture sets in retainedElementsRaw [#23571](https://github.com/scala/scala3/pull/23571)
+- Fix well-formed test for capabilities [#23393](https://github.com/scala/scala3/pull/23393)
+- Add restricted capabilities `x.only[C]` [#23485](https://github.com/scala/scala3/pull/23485)
+- Rely on hidden sets for use checking [#23580](https://github.com/scala/scala3/pull/23580)
+
+## Experimental: Seperation Checking
+
+- Make separation checking controlled by language import [#23560](https://github.com/scala/scala3/pull/23560)
+
+## Experimental: Erased Definitions
+
+- Refactorings and fixes to erased definition handling [#23404](https://github.com/scala/scala3/pull/23404)
+
+## Experimental: Explicit Nulls
+
+- Add quick fix to remove unnecessary .nn [#23461](https://github.com/scala/scala3/pull/23461)
+- Add `stableNull` annotation to force tracking mutable fields [#23528](https://github.com/scala/scala3/pull/23528)
+
+## Experimental: Global Initialization
+
+- Rewrite resolveThis in global init checker [#23282](https://github.com/scala/scala3/pull/23282)
+- Fix errors in the global initialization checker when compiling bootstrapped dotty [#23429](https://github.com/scala/scala3/pull/23429)
+- Fix error in product-sequence match in global init checker [#23480](https://github.com/scala/scala3/pull/23480)
+
+## Experimental: Into
+
+- Fix isConversionTargetType test [#23401](https://github.com/scala/scala3/pull/23401)
+
+## Experimental: Modularity
+
+- Refinements to skolemizaton [#23513](https://github.com/scala/scala3/pull/23513)
+
+## Experimental: Unroll
+
+- Enable UnrollDefinitions phase in REPL frontend phases [#23433](https://github.com/scala/scala3/pull/23433)
+
+## Extension Methods
+
+- Avoid forcing extension on check of local select [#23439](https://github.com/scala/scala3/pull/23439)
+
+## Implicits
+
+- Refine implicit search fallbacks for better ClassTag handling [#23532](https://github.com/scala/scala3/pull/23532)
+
+## Inline
+
+- Fix Symbol.info remapping in TreeTypeMap [#23432](https://github.com/scala/scala3/pull/23432)
+- Fail not inlined inline method calls early [#22925](https://github.com/scala/scala3/pull/22925)
+- Fix inline export forwarder generation regression [#23126](https://github.com/scala/scala3/pull/23126)
+
+## Linting
+
+- Consider setter of effectively private var [#23211](https://github.com/scala/scala3/pull/23211)
+- Add accessible check for import usage [#23348](https://github.com/scala/scala3/pull/23348)
+- Check OrType in interpolated toString lint [#23365](https://github.com/scala/scala3/pull/23365)
+- Use result of lambda type of implicit in CheckUnused [#23497](https://github.com/scala/scala3/pull/23497)
+
+## Match Types
+
+- Fix: #23261 Distinguish 0.0 and -0.0 in ConstantType match types [#23265](https://github.com/scala/scala3/pull/23265)
+
+## Named Tuples
+
+- Skip bypassing unapply for scala 2 case classes to allow for single-element named tuple in unapply [#23603](https://github.com/scala/scala3/pull/23603)
+
+## Parser
+
+- Enforce `-new-syntax` under `-language:future` [#23443](https://github.com/scala/scala3/pull/23443)
+- Disallow Scala 2 implicits under `-source:future` [#23472](https://github.com/scala/scala3/pull/23472)
+
+## Pattern Matching
+
+- Fix problems in checking that a constructor is uninhabited for exhaustive match checking [#23403](https://github.com/scala/scala3/pull/23403)
+
+## Pickling
+
+- Don't force annotation unpickling when testing for SilentIntoAnnot [#23506](https://github.com/scala/scala3/pull/23506)
+- Drop invalid assumption from TastyUnpickler [#23353](https://github.com/scala/scala3/pull/23353)
+
+## Printer
+
+- Print update modifier when printing update method definitions [#23392](https://github.com/scala/scala3/pull/23392)
+
+## Positions
+
+- Compare span points in pathTo to determine best span [#23581](https://github.com/scala/scala3/pull/23581)
+- Add line number magic comment support [#23549](https://github.com/scala/scala3/pull/23549)
+
+## Presentation Compiler
+
+- Port Inlay hints for name parameters [#23375](https://github.com/scala/scala3/pull/23375)
+- Fix: Simplify infer type for apply [#23434](https://github.com/scala/scala3/pull/23434)
+- Fix: Inconsistent annotation tooltips [#23454](https://github.com/scala/scala3/pull/23454)
+- Fix adjust type when already exists [#23455](https://github.com/scala/scala3/pull/23455)
+- Exclude named parameters inlay hints for java defined [#23462](https://github.com/scala/scala3/pull/23462)
+- Fix: StringIndexOutOfBoundsException in presentation compiler's hasColon method [#23498](https://github.com/scala/scala3/pull/23498)
+- Add InferredMethodProvider for automatic method signature generation [#23563](https://github.com/scala/scala3/pull/23563)
+- Fix completions for Quotes [#23619](https://github.com/scala/scala3/pull/23619)
+- Handle default arguments in named parameters for inlay hints [#23641](https://github.com/scala/scala3/pull/23641)
+
+## Quotes
+
+- Skip splice level checking for `<refinement>` symbols [#22782](https://github.com/scala/scala3/pull/22782)
+- Fix stale top level synthetic package object being used in later runs [#23464](https://github.com/scala/scala3/pull/23464)
+- Emit an error for quoted pattern type variable after `new` [#23618](https://github.com/scala/scala3/pull/23618)
+- Fix issue with certain polyfunctions not properly matching in macros [#23614](https://github.com/scala/scala3/pull/23614)
+- Check PCP of constructor calls on the type [#7531](https://github.com/scala/scala3/pull/7531)
+
+## Reflection
+
+- Quotes reflect: sort the typeMembers output list and filter out non-members [#22876](https://github.com/scala/scala3/pull/22876)
+
+## Reporting
+
+- Add an explainer to the DoubleDefinition error [#23470](https://github.com/scala/scala3/pull/23470)
+- Suppress warnings in comprehensions with 22+ binds [#23590](https://github.com/scala/scala3/pull/23590)
+- Unhelpful error message when trying to use named extraction, when not matching case class or named tuple [#23354](https://github.com/scala/scala3/pull/23354)
+- Improve error message for conflicting definitions [#23453](https://github.com/scala/scala3/pull/23453)
+- `-Yprofile-trace` properly report macro splicing source [#23488](https://github.com/scala/scala3/pull/23488)
+- `-Yprofile-trace` profiles all inline calls [#23490](https://github.com/scala/scala3/pull/23490)
+
+## Rewrites
+
+- Patch empty implicit parens on error recovery [#22835](https://github.com/scala/scala3/pull/22835)
+- Rewrite underscore with optional space [#23525](https://github.com/scala/scala3/pull/23525)
+
+## Scaladoc
+
+- Scaladoc: fixes and improvements to context bounds and extension methods [#22156](https://github.com/scala/scala3/pull/22156)
+- Encode path of class [#23503](https://github.com/scala/scala3/pull/23503)
+
+## SemanticDB
+
+- Bugfix: Also save infos in semanticdb [#23587](https://github.com/scala/scala3/pull/23587)
+
+## Transform
+
+- Handle multiple type parameter lists in value class methods [#23516](https://github.com/scala/scala3/pull/23516)
+- Check path of module prefix for tailrec [#23491](https://github.com/scala/scala3/pull/23491)
+
+## Tuples
+
+- Normalize tuple types in var args seq literals and classOf instances [#23465](https://github.com/scala/scala3/pull/23465)
+
+## Typer
+
+- Fix #22922: Add TypeParamRef handling in isSingletonBounded [#23501](https://github.com/scala/scala3/pull/23501)
+- Fix this references everywhere in dependent function types [#23514](https://github.com/scala/scala3/pull/23514)
+- Don't approximate a type using `Nothing` as prefix [#23531](https://github.com/scala/scala3/pull/23531)
+- Support cleanup actions in class completers [#23515](https://github.com/scala/scala3/pull/23515)
+- Fix regressions in asSeenFrom introduced in 3.7 [#23438](https://github.com/scala/scala3/pull/23438)
+- Use correct owner in eta expansion [#7564](https://github.com/scala/scala3/pull/7564)
+- Fix irrefutability checking in `for` with untupling [#23273](https://github.com/scala/scala3/pull/23273)
+- Fix missing members reporting for var setters [#23476](https://github.com/scala/scala3/pull/23476)
+- Guard against invalid prefixes in argForParam [#23508](https://github.com/scala/scala3/pull/23508)
+- Add missing case to TypeComparer [#23550](https://github.com/scala/scala3/pull/23550)
+
+# Contributors
+
+Thank you to all the contributors who made this release possible 🎉
+
+According to `git shortlog -sn --no-merges 3.7.2..3.7.3-RC1` these are:
+
+```
+    80  Martin Odersky
+    56  Hamza Remmal
+    22  Wojciech Mazur
+    20  noti0na1
+    18  Yichen Xu
+    16  Som Snytt
+    14  Jan Chyb
+     9  Matt Bovel
+     7  EnzeXing
+     6  Guillaume Martres
+     5  Sébastien Doeraene
+     5  aherlihy
+     4  Zieliński Patryk
+     3  Oliver Bračevac
+     3  Tomasz Godzik
+     2  Alexander
+     2  Mikołaj Fornal
+     2  Piotr Chabelski
+     2  Seyon Sivatharan
+     1  Alex1005a
+     1  HarrisL2
+     1  Jan
+     1  Jentsch
+     1  Jędrzej Rochala
+     1  Katarzyna Marek
+     1  Marc GRIS
+     1  Martin Duhem
+     1  Patryk Zieliński
+     1  Przemysław Sajnóg
+     1  Seth Tisue
+     1  Wessel W. Bakker
+     1  bingchen-li
+     1  kijuky
+```
diff --git a/compiler/src/dotty/tools/dotc/ast/Positioned.scala b/compiler/src/dotty/tools/dotc/ast/Positioned.scala
index d8017783f47f..5b57733eaeb1 100644
--- a/compiler/src/dotty/tools/dotc/ast/Positioned.scala
+++ b/compiler/src/dotty/tools/dotc/ast/Positioned.scala
@@ -3,7 +3,8 @@ package dotc
 package ast
 
 import util.Spans.*
-import util.{SourceFile, SourcePosition, SrcPos}
+import util.{SourceFile, SourcePosition, SrcPos, WrappedSourceFile}
+import WrappedSourceFile.MagicHeaderInfo, MagicHeaderInfo.*
 import core.Contexts.*
 import core.Decorators.*
 import core.NameOps.*
@@ -51,7 +52,15 @@ abstract class Positioned(implicit @constructorOnly src: SourceFile) extends Src
 
   def source: SourceFile = mySource
 
-  def sourcePos(using Context): SourcePosition = source.atSpan(span)
+  def sourcePos(using Context): SourcePosition =
+    val info = WrappedSourceFile.locateMagicHeader(source)
+    info match
+      case HasHeader(offset, originalFile) =>
+        if span.start >= offset then  // This span is in user code
+          originalFile.atSpan(span.shift(-offset))
+        else  // Otherwise, return the source position in the wrapper code
+          source.atSpan(span)
+      case _ => source.atSpan(span)
 
   /** This positioned item, widened to `SrcPos`. Used to make clear we only need the
    *  position, typically for error reporting.
diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
index 5cdc742fa753..a3fa5fd9bb06 100644
--- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
+++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
@@ -444,6 +444,8 @@ private sealed trait YSettings:
   val YbestEffort: Setting[Boolean] = BooleanSetting(ForkSetting, "Ybest-effort", "Enable best-effort compilation attempting to produce betasty to the META-INF/best-effort directory, regardless of errors, as part of the pickler phase.")
   val YwithBestEffortTasty: Setting[Boolean] = BooleanSetting(ForkSetting, "Ywith-best-effort-tasty", "Allow to compile using best-effort tasty files. If such file is used, the compiler will stop after the pickler phase.")
 
+  val YmagicOffsetHeader: Setting[String] = StringSetting(ForkSetting, "Ymagic-offset-header", "header", "Specify the magic header comment that marks the start of the actual code in generated wrapper scripts. Example: -Ymagic-offset-header:SOURCE_CODE_START. Then, in the source, the magic comment `///SOURCE_CODE_START:<ORIGINAL_FILE_PATH>` marks the start of user code. The comment should be suffixed by `:<ORIGINAL_FILE_PATH>` to indicate the original file.", "")
+
   // Experimental language features
   @deprecated(message = "This flag has no effect and will be removed in a future version.", since = "3.7.0")
   val YnoKindPolymorphism: Setting[Boolean] = BooleanSetting(ForkSetting, "Yno-kind-polymorphism", "Disable kind polymorphism. (This flag has no effect)", deprecation = Deprecation.removed())
diff --git a/compiler/src/dotty/tools/dotc/reporting/ErrorMessageID.scala b/compiler/src/dotty/tools/dotc/reporting/ErrorMessageID.scala
index 2dedcd788ec4..24c3d2e412f7 100644
--- a/compiler/src/dotty/tools/dotc/reporting/ErrorMessageID.scala
+++ b/compiler/src/dotty/tools/dotc/reporting/ErrorMessageID.scala
@@ -232,6 +232,7 @@ enum ErrorMessageID(val isActive: Boolean = true) extends java.lang.Enum[ErrorMe
   case UnnecessaryNN // errorNumber: 216
   case ErasedNotPureID // errorNumber: 217
   case IllegalErasedDefID // errorNumber: 218
+  case CannotInstantiateQuotedTypeVarID // errorNumber: 219
 
   def errorNumber = ordinal - 1
 
diff --git a/compiler/src/dotty/tools/dotc/reporting/MessageRendering.scala b/compiler/src/dotty/tools/dotc/reporting/MessageRendering.scala
index 7fddfc8d6ed0..0414bdb3c58b 100644
--- a/compiler/src/dotty/tools/dotc/reporting/MessageRendering.scala
+++ b/compiler/src/dotty/tools/dotc/reporting/MessageRendering.scala
@@ -11,7 +11,7 @@ import core.Decorators.*
 import printing.Highlighting.{Blue, Red, Yellow}
 import printing.SyntaxHighlighting
 import Diagnostic.*
-import util.{ SourcePosition, NoSourcePosition }
+import util.{SourcePosition, NoSourcePosition}
 import util.Chars.{ LF, CR, FF, SU }
 import scala.annotation.switch
 
diff --git a/compiler/src/dotty/tools/dotc/reporting/messages.scala b/compiler/src/dotty/tools/dotc/reporting/messages.scala
index eb5e692b2915..f84fd3ba538e 100644
--- a/compiler/src/dotty/tools/dotc/reporting/messages.scala
+++ b/compiler/src/dotty/tools/dotc/reporting/messages.scala
@@ -3435,6 +3435,18 @@ final class QuotedTypeMissing(tpe: Type)(using Context) extends StagingMessage(Q
 
 end QuotedTypeMissing
 
+final class CannotInstantiateQuotedTypeVar(symbol: Symbol)(using patternCtx: Context) extends StagingMessage(CannotInstantiateQuotedTypeVarID):
+  override protected def msg(using Context): String =
+    i"""Quoted pattern type variable `${symbol.name}` cannot be instantiated.
+      |If you meant to refer to a class named `${symbol.name}`, wrap it in backticks.
+      |If you meant to introduce a binding, this is not allowed after `new`. You might
+      |want to use the lower-level `quotes.reflect` API instead.
+      |Read more about type variables in quoted pattern in the Scala documentation:
+      |https://docs.scala-lang.org/scala3/guides/macros/quotes.html#type-variables-in-quoted-patterns
+    """
+
+  override protected def explain(using Context): String = ""
+
 final class DeprecatedAssignmentSyntax(key: Name, value: untpd.Tree)(using Context) extends SyntaxMsg(DeprecatedAssignmentSyntaxID):
   override protected def msg(using Context): String =
     i"""Deprecated syntax: since 3.7 this is interpreted as a named tuple with one element,
diff --git a/compiler/src/dotty/tools/dotc/rewrites/Rewrites.scala b/compiler/src/dotty/tools/dotc/rewrites/Rewrites.scala
index 3c7216625a7c..272db26bdd3c 100644
--- a/compiler/src/dotty/tools/dotc/rewrites/Rewrites.scala
+++ b/compiler/src/dotty/tools/dotc/rewrites/Rewrites.scala
@@ -7,7 +7,7 @@ import core.Contexts.*
 import collection.mutable
 import scala.annotation.tailrec
 import dotty.tools.dotc.reporting.Reporter
-import dotty.tools.dotc.util.SourcePosition;
+import dotty.tools.dotc.util.SourcePosition
 
 import java.io.OutputStreamWriter
 import java.nio.charset.StandardCharsets.UTF_8
diff --git a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala
index e2505144abda..778a97f6c38b 100644
--- a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala
+++ b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala
@@ -343,7 +343,13 @@ object PatternMatcher {
               receiver.ensureConforms(defn.NonEmptyTupleTypeRef), // If scrutinee is a named tuple, cast to underlying tuple
               Literal(Constant(i)))
 
-        if (isSyntheticScala2Unapply(unapp.symbol) && caseAccessors.length == args.length)
+        def getOfGetMatch(gm: Tree) = gm.select(nme.get, _.info.isParameterless)
+        // Disable Scala2Unapply optimization if the argument is a named argument for a single-element named tuple to
+        // enable selecting the field. See i23131.scala for test cases.
+        val wasUnaryNamedTupleSelectArgForNamedTuple =
+          args.length == 1 && args.head.removeAttachment(FirstTransform.WasNamedArg).isDefined &&
+            isGetMatch(unappType) && getOfGetMatch(unapp).tpe.widenDealias.isNamedTupleType
+        if (isSyntheticScala2Unapply(unapp.symbol) && caseAccessors.length == args.length && !wasUnaryNamedTupleSelectArgForNamedTuple)
           def tupleSel(sym: Symbol) =
             // If scrutinee is a named tuple, cast to underlying tuple, so that we can
             // continue to select with _1, _2, ...
@@ -376,7 +382,7 @@ object PatternMatcher {
             else {
               assert(isGetMatch(unappType))
               val argsPlan = {
-                val get = ref(unappResult).select(nme.get, _.info.isParameterless)
+                val get = getOfGetMatch(ref(unappResult))
                 val arity = productArity(get.tpe.stripNamedTuple, unapp.srcPos)
                 if (isUnapplySeq)
                   letAbstract(get) { getResult =>
@@ -386,9 +392,6 @@ object PatternMatcher {
                   }
                 else
                   letAbstract(get) { getResult =>
-                    def isUnaryNamedTupleSelectArg(arg: Tree) =
-                      get.tpe.widenDealias.isNamedTupleType
-                      && arg.removeAttachment(FirstTransform.WasNamedArg).isDefined
                     // Special case: Normally, we pull out the argument wholesale if
                     // there is only one. But if the argument is a named argument for
                     // a single-element named tuple, we have to select the field instead.
@@ -396,7 +399,7 @@ object PatternMatcher {
                     // of patterns we add a WasNamedArg attachment, which is used to guide the
                     // logic here. See i22900.scala for test cases.
                     val selectors = args match
-                      case arg :: Nil if !isUnaryNamedTupleSelectArg(arg) =>
+                      case arg :: Nil if !wasUnaryNamedTupleSelectArgForNamedTuple =>
                         ref(getResult) :: Nil
                       case _ =>
                         productSelectors(getResult.info).map(ref(getResult).select(_))
diff --git a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
index 50363759c542..b7e1f349a377 100644
--- a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
+++ b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
@@ -685,7 +685,7 @@ object SpaceEngine {
           val refined = trace(i"refineUsingParent($tp, $sym1, $mixins)")(TypeOps.refineUsingParent(tp, sym1, mixins))
 
           def containsUninhabitedField(tp: Type): Boolean =
-            tp.fields.exists { field =>
+            !tp.typeSymbol.is(ModuleClass) && tp.fields.exists { field =>
               !field.symbol.flags.is(Lazy) && field.info.dealias.isBottomType
             }
 
diff --git a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala
index 4e7c4336b852..f979654e9811 100644
--- a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala
+++ b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala
@@ -222,7 +222,7 @@ trait QuotesAndSplices {
         if ctx.mode.is(Mode.InPatternAlternative) then
           report.error(IllegalVariableInPatternAlternative(tree.name), tree.srcPos)
         val typeSym = inContext(quotePatternOuterContext(ctx)) {
-          newSymbol(ctx.owner, tree.name.toTypeName, Case, typeSymInfo, NoSymbol, tree.span)
+          newSymbol(ctx.owner, tree.name.toTypeName, Synthetic | Case, typeSymInfo, NoSymbol, tree.span)
         }
         addQuotedPatternTypeVariable(typeSym)
         Bind(typeSym, untpd.Ident(nme.WILDCARD).withType(typeSymInfo)).withSpan(tree.span)
diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala
index 10a061ab8fc4..c45c00845120 100644
--- a/compiler/src/dotty/tools/dotc/typer/Typer.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -1237,6 +1237,9 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
       case _ =>
         var tpt1 = typedType(tree.tpt)
         val tsym = tpt1.tpe.underlyingClassRef(refinementOK = false).typeSymbol
+        if ctx.mode.isQuotedPattern && tpt1.tpe.typeSymbol.isAllOf(Synthetic | Case) then
+          val errorTp = errorType(CannotInstantiateQuotedTypeVar(tpt1.tpe.typeSymbol), tpt1.srcPos)
+          return cpy.New(tree)(tpt1).withType(errorTp)
         if tsym.is(Package) then
           report error(em"$tsym cannot be instantiated", tpt1.srcPos)
         tpt1 = tpt1.withType(ensureAccessible(tpt1.tpe, superAccess = false, tpt1.srcPos))
diff --git a/compiler/src/dotty/tools/dotc/util/SourceFile.scala b/compiler/src/dotty/tools/dotc/util/SourceFile.scala
index eb99fe99d926..9cc3dc5e731d 100644
--- a/compiler/src/dotty/tools/dotc/util/SourceFile.scala
+++ b/compiler/src/dotty/tools/dotc/util/SourceFile.scala
@@ -7,6 +7,7 @@ import scala.language.unsafeNulls
 import dotty.tools.io.*
 import Spans.*
 import core.Contexts.*
+import core.Decorators.*
 
 import scala.io.Codec
 import Chars.*
@@ -61,6 +62,36 @@ object ScriptSourceFile {
   }
 }
 
+object WrappedSourceFile:
+  enum MagicHeaderInfo:
+    case HasHeader(offset: Int, originalFile: SourceFile)
+    case NoHeader
+  import MagicHeaderInfo.*
+
+  private val cache: mutable.HashMap[SourceFile, MagicHeaderInfo] = mutable.HashMap.empty
+
+  def locateMagicHeader(sourceFile: SourceFile)(using Context): MagicHeaderInfo =
+    def findOffset: MagicHeaderInfo =
+      val magicHeader = ctx.settings.YmagicOffsetHeader.value
+      if magicHeader.isEmpty then NoHeader
+      else
+        val text = new String(sourceFile.content)
+        val headerQuoted = java.util.regex.Pattern.quote("///" + magicHeader)
+        val regex = s"(?m)^$headerQuoted:(.+)$$".r
+        regex.findFirstMatchIn(text) match
+          case Some(m) =>
+            val markerOffset = m.start
+            val sourceStartOffset = sourceFile.nextLine(markerOffset)
+            val file = ctx.getFile(m.group(1))
+            if file.exists then
+              HasHeader(sourceStartOffset, ctx.getSource(file))
+            else
+              report.warning(em"original source file not found: ${file.path}")
+              NoHeader
+          case None => NoHeader
+    val result = cache.getOrElseUpdate(sourceFile, findOffset)
+    result
+
 class SourceFile(val file: AbstractFile, computeContent: => Array[Char]) extends interfaces.SourceFile {
   import SourceFile.*
 
diff --git a/presentation-compiler/src/main/dotty/tools/pc/PcInlayHintsProvider.scala b/presentation-compiler/src/main/dotty/tools/pc/PcInlayHintsProvider.scala
index b22b3ae8b7f4..29396a5c0d32 100644
--- a/presentation-compiler/src/main/dotty/tools/pc/PcInlayHintsProvider.scala
+++ b/presentation-compiler/src/main/dotty/tools/pc/PcInlayHintsProvider.scala
@@ -19,6 +19,7 @@ import dotty.tools.dotc.core.Contexts.Context
 import dotty.tools.dotc.core.Flags
 import dotty.tools.dotc.core.NameOps.fieldName
 import dotty.tools.dotc.core.Names.Name
+import dotty.tools.dotc.core.NameKinds.DefaultGetterName
 import dotty.tools.dotc.core.StdNames.*
 import dotty.tools.dotc.core.Symbols.*
 import dotty.tools.dotc.core.Types.*
@@ -457,6 +458,13 @@ object Parameters:
         case TypeApply(fun, _) => getUnderlyingFun(fun)
         case t => t
 
+    @tailrec
+    def isDefaultArg(arg: Tree): Boolean = arg match
+      case Ident(name) => name.is(DefaultGetterName)
+      case Select(_, name) => name.is(DefaultGetterName)
+      case Apply(fun, _) => isDefaultArg(fun)
+      case _ => false
+
     if (params.namedParameters() || params.byNameParameters()) then
       tree match
         case Apply(fun, args) if isRealApply(fun) => 
@@ -467,15 +475,16 @@ object Parameters:
             val funTp = fun.typeOpt.widenTermRefExpr
             val paramNames = funTp.paramNamess.flatten
             val paramInfos = funTp.paramInfoss.flatten
+            
             Some(
-              // Check if the function is an infix function or the underlying function is an infix function
               isInfixFun(fun, args) || underlyingFun.isInfix,
               (
                 args
                 .zip(paramNames)
                 .zip(paramInfos)
                 .collect {
-                  case ((arg, paramName), paramInfo) if !arg.span.isZeroExtent => (paramName.fieldName, arg.sourcePos, paramInfo.isByName)
+                  case ((arg, paramName), paramInfo) if !arg.span.isZeroExtent && !isDefaultArg(arg) => 
+                    (paramName.fieldName, arg.sourcePos, paramInfo.isByName)
                 }
               )
             )
diff --git a/presentation-compiler/test/dotty/tools/pc/tests/inlayHints/InlayHintsSuite.scala b/presentation-compiler/test/dotty/tools/pc/tests/inlayHints/InlayHintsSuite.scala
index bb79c19f5823..d9c10080581f 100644
--- a/presentation-compiler/test/dotty/tools/pc/tests/inlayHints/InlayHintsSuite.scala
+++ b/presentation-compiler/test/dotty/tools/pc/tests/inlayHints/InlayHintsSuite.scala
@@ -1277,4 +1277,61 @@ class InlayHintsSuite extends BaseInlayHintsSuite {
         |}
         |""".stripMargin
     )
+
+  @Test def `default-parameter` =
+    check(
+      """|object Main {
+         |  def foo(a: Int, b: Int = 2) = a + b
+         |  val x = foo(1)
+         |}
+         |""".stripMargin,
+      """|object Main {
+         |  def foo(a: Int, b: Int = 2)/*: Int<<scala/Int#>>*/ = a + b
+         |  val x/*: Int<<scala/Int#>>*/ = foo(/*a = */1)
+         |}
+         |""".stripMargin
+    )
+
+  @Test def `default-parameter-2` =
+    check(
+      """|object Main {
+         |  def foo(a: Int = 10, b: Int = 2) = a + b
+         |  val x = foo(b = 1)
+         |}
+         |""".stripMargin,
+      """|object Main {
+         |  def foo(a: Int = 10, b: Int = 2)/*: Int<<scala/Int#>>*/ = a + b
+         |  val x/*: Int<<scala/Int#>>*/ = foo(b = 1)
+         |}
+         |""".stripMargin
+    )
+
+  @Test def `default-parameter-3` =
+    check(
+      """|object Main {
+         |  def foo(a: Int, b: Int = 2, c: Int) = a + b + c
+         |  val x = foo(a = 1, c = 2)
+         |}
+         |""".stripMargin,
+      """|object Main {
+         |  def foo(a: Int, b: Int = 2, c: Int)/*: Int<<scala/Int#>>*/ = a + b + c
+         |  val x/*: Int<<scala/Int#>>*/ = foo(a = 1, c = 2)
+         |}
+         |""".stripMargin
+    )
+
+  @Test def `default-parameter-4` =
+    check(
+      """|object Main {
+         |  def foo(a: Int, b: Int = 2, c: Int) = a + b + c
+         |  val x = foo(1, 2, 3)
+         |}
+         |""".stripMargin,
+      """|object Main {
+         |  def foo(a: Int, b: Int = 2, c: Int)/*: Int<<scala/Int#>>*/ = a + b + c
+         |  val x/*: Int<<scala/Int#>>*/ = foo(/*a = */1, /*b = */2, /*c = */3)
+         |}
+         |""".stripMargin
+    )
+
 }
diff --git a/project/Build.scala b/project/Build.scala
index 08433784c4ae..eed594bb3610 100644
--- a/project/Build.scala
+++ b/project/Build.scala
@@ -52,7 +52,7 @@ object Build {
    *
    *  Warning: Change of this variable needs to be consulted with `expectedTastyVersion`
    */
-  val referenceVersion = "3.7.2-RC2"
+  val referenceVersion = "3.7.2"
 
   /** Version of the Scala compiler targeted in the current release cycle
    *  Contains a version without RC/SNAPSHOT/NIGHTLY specific suffixes
@@ -90,7 +90,7 @@ object Build {
    *      - in release candidate branch is experimental if {patch == 0}
    *      - in stable release is always non-experimetnal
    */
-  val expectedTastyVersion = "28.8-experimental-1"
+  val expectedTastyVersion = "28.7"
   checkReleasedTastyVersion()
 
   /** Final version of Scala compiler, controlled by environment variables. */
diff --git a/tasty/src/dotty/tools/tasty/TastyFormat.scala b/tasty/src/dotty/tools/tasty/TastyFormat.scala
index 37e3a3acfdab..4c1453243450 100644
--- a/tasty/src/dotty/tools/tasty/TastyFormat.scala
+++ b/tasty/src/dotty/tools/tasty/TastyFormat.scala
@@ -324,7 +324,7 @@ object TastyFormat {
    *  compatibility, but remains backwards compatible, with all
    *  preceding `MinorVersion`.
    */
-  final val MinorVersion: Int = 8
+  final val MinorVersion: Int = 7
 
   /** Natural Number. The `ExperimentalVersion` allows for
    *  experimentation with changes to TASTy without committing
@@ -340,7 +340,7 @@ object TastyFormat {
    *  is able to read final TASTy documents if the file's
    *  `MinorVersion` is strictly less than the current value.
    */
-  final val ExperimentalVersion: Int = 1
+  final val ExperimentalVersion: Int = 0
 
   /**This method implements a binary relation (`<:<`) between two TASTy versions.
    *
diff --git a/tests/neg-macros/i22616.check b/tests/neg-macros/i22616.check
new file mode 100644
index 000000000000..d830d0c3fe00
--- /dev/null
+++ b/tests/neg-macros/i22616.check
@@ -0,0 +1,16 @@
+-- [E219] Staging Issue Error: tests/neg-macros/i22616.scala:13:22 -----------------------------------------------------
+13 |          case '{ new caseName(${ Expr(name) }) } => Some(caseName(name))  // error // error
+   |                      ^^^^^^^^
+   |                  Quoted pattern type variable `caseName` cannot be instantiated.
+   |                  If you meant to refer to a class named `caseName`, wrap it in backticks.
+   |                  If you meant to introduce a binding, this is not allowed after `new`. You might
+   |                  want to use the lower-level `quotes.reflect` API instead.
+   |                  Read more about type variables in quoted pattern in the Scala documentation:
+   |                  https://docs.scala-lang.org/scala3/guides/macros/quotes.html#type-variables-in-quoted-patterns
+   |                      
+-- [E006] Not Found Error: tests/neg-macros/i22616.scala:13:67 ---------------------------------------------------------
+13 |          case '{ new caseName(${ Expr(name) }) } => Some(caseName(name))  // error // error
+   |                                                                   ^^^^
+   |                                                                   Not found: name
+   |
+   | longer explanation available when compiling with `-explain`
diff --git a/tests/neg-macros/i22616.scala b/tests/neg-macros/i22616.scala
new file mode 100644
index 000000000000..bd86716bc30c
--- /dev/null
+++ b/tests/neg-macros/i22616.scala
@@ -0,0 +1,18 @@
+import scala.quoted.*
+
+final case class caseName(name: String) extends scala.annotation.Annotation
+object caseName {
+
+  given FromExpr[caseName] =
+    new FromExpr[caseName] {
+      override def unapply(x: Expr[caseName])(using Quotes): Option[caseName] =
+        val y: Int = 42
+        x match {
+          case '{ caseName(${ Expr(name) }) }     => Some(caseName(name))
+          // with/without the following line...
+          case '{ new caseName(${ Expr(name) }) } => Some(caseName(name))  // error // error
+          case _                                  => println(x.show); None
+        }
+    }
+
+}
diff --git a/tests/neg-macros/i22616b.check b/tests/neg-macros/i22616b.check
new file mode 100644
index 000000000000..3c6007276cef
--- /dev/null
+++ b/tests/neg-macros/i22616b.check
@@ -0,0 +1,13 @@
+-- [E007] Type Mismatch Error: tests/neg-macros/i22616b.scala:17:18 ----------------------------------------------------
+17 |      case '{ Foo($y: t) } => // error
+   |                  ^^^^^
+   |                  Found:    t
+   |                  Required: String
+   |
+   | longer explanation available when compiling with `-explain`
+-- [E006] Not Found Error: tests/neg-macros/i22616b.scala:18:19 --------------------------------------------------------
+18 |        '{type S = t; ()} // error
+   |                   ^
+   |                   Not found: type t
+   |
+   | longer explanation available when compiling with `-explain`
diff --git a/tests/neg-macros/i22616b.scala b/tests/neg-macros/i22616b.scala
new file mode 100644
index 000000000000..45926f4e0d37
--- /dev/null
+++ b/tests/neg-macros/i22616b.scala
@@ -0,0 +1,22 @@
+// This test illustrates a current limitation of quoted pattern type variables,
+// which has been discussed in https://github.com/scala/scala3/issues/22616#issuecomment-3012534064:
+// These type variables do not have bound in general (see `typedQuotedTypeVar`),
+// so they might not conform to the expected type. Here, `t` does not conform
+// to `String`.
+
+import scala.quoted.{FromExpr, Expr, Quotes}
+
+case class Foo(x: String)
+
+object Macro:
+  inline def myMacro(): Unit =
+    ${ myMacroImpl('{Foo("hello")}) }
+
+  def myMacroImpl(x: Expr[Foo])(using Quotes): Expr[Unit] =
+    x match
+      case '{ Foo($y: t) } => // error
+        '{type S = t; ()} // error
+      case _ =>
+        println("not a foo")
+
+    '{()}
diff --git a/tests/neg/magic-offset-header-a.scala b/tests/neg/magic-offset-header-a.scala
new file mode 100644
index 000000000000..48267a7853f0
--- /dev/null
+++ b/tests/neg/magic-offset-header-a.scala
@@ -0,0 +1,2 @@
+
+def test1(): Int = "无穷"  // error
diff --git a/tests/neg/magic-offset-header-a_wrapper.check b/tests/neg/magic-offset-header-a_wrapper.check
new file mode 100644
index 000000000000..0ab253c12804
--- /dev/null
+++ b/tests/neg/magic-offset-header-a_wrapper.check
@@ -0,0 +1,7 @@
+-- [E007] Type Mismatch Error: tests/neg/magic-offset-header-a.scala:2:19 ----------------------------------------------
+2 |def test1(): Int = "无穷"  // error
+  |                   ^^^^
+  |                   Found:    ("无穷" : String)
+  |                   Required: Int
+  |
+  | longer explanation available when compiling with `-explain`
diff --git a/tests/neg/magic-offset-header-a_wrapper.scala b/tests/neg/magic-offset-header-a_wrapper.scala
new file mode 100644
index 000000000000..af4f2b8bf8dd
--- /dev/null
+++ b/tests/neg/magic-offset-header-a_wrapper.scala
@@ -0,0 +1,7 @@
+//> using options -Ymagic-offset-header:TEST_MARKER
+val t1 = 1
+val t2 = 2
+val t3 = 3
+///TEST_MARKER:tests/neg/magic-offset-header-a.scala
+
+def test1(): Int = "无穷"  // anypos-error
diff --git a/tests/neg/magic-offset-header-b.scala b/tests/neg/magic-offset-header-b.scala
new file mode 100644
index 000000000000..aeb569272523
--- /dev/null
+++ b/tests/neg/magic-offset-header-b.scala
@@ -0,0 +1,2 @@
+
+def y: Int = false  // error
diff --git a/tests/neg/magic-offset-header-b_wrapper.check b/tests/neg/magic-offset-header-b_wrapper.check
new file mode 100644
index 000000000000..5d862e5a6b10
--- /dev/null
+++ b/tests/neg/magic-offset-header-b_wrapper.check
@@ -0,0 +1,14 @@
+-- [E007] Type Mismatch Error: tests/neg/magic-offset-header-b_wrapper.scala:3:13 --------------------------------------
+3 |def x: Int = true  // error
+  |             ^^^^
+  |             Found:    (true : Boolean)
+  |             Required: Int
+  |
+  | longer explanation available when compiling with `-explain`
+-- [E007] Type Mismatch Error: tests/neg/magic-offset-header-b.scala:2:13 ----------------------------------------------
+2 |def y: Int = false  // error
+  |             ^^^^^
+  |             Found:    (false : Boolean)
+  |             Required: Int
+  |
+  | longer explanation available when compiling with `-explain`
diff --git a/tests/neg/magic-offset-header-b_wrapper.scala b/tests/neg/magic-offset-header-b_wrapper.scala
new file mode 100644
index 000000000000..ef0e552948d3
--- /dev/null
+++ b/tests/neg/magic-offset-header-b_wrapper.scala
@@ -0,0 +1,7 @@
+//> using options -Ymagic-offset-header:TEST_MARKER
+
+def x: Int = true  // error
+
+///TEST_MARKER:tests/neg/magic-offset-header-b.scala
+
+def y: Int = false  // anypos-error
diff --git a/tests/neg/magic-offset-header-c.scala b/tests/neg/magic-offset-header-c.scala
new file mode 100644
index 000000000000..be3cb333abff
--- /dev/null
+++ b/tests/neg/magic-offset-header-c.scala
@@ -0,0 +1,3 @@
+
+def userCode =
+  val x: String = 0  // error
diff --git a/tests/neg/magic-offset-header-c_wrapper.check b/tests/neg/magic-offset-header-c_wrapper.check
new file mode 100644
index 000000000000..0c33f5ea0338
--- /dev/null
+++ b/tests/neg/magic-offset-header-c_wrapper.check
@@ -0,0 +1,7 @@
+-- [E007] Type Mismatch Error: tests/neg/magic-offset-header-c.scala:3:18 ----------------------------------------------
+3 |  val x: String = 0  // error
+  |                  ^
+  |                  Found:    (0 : Int)
+  |                  Required: String
+  |
+  | longer explanation available when compiling with `-explain`
diff --git a/tests/neg/magic-offset-header-c_wrapper.scala b/tests/neg/magic-offset-header-c_wrapper.scala
new file mode 100644
index 000000000000..51804a647fbe
--- /dev/null
+++ b/tests/neg/magic-offset-header-c_wrapper.scala
@@ -0,0 +1,8 @@
+//> using options -Ymagic-offset-header:SOURCE_CODE_START_MARKER
+
+val generatedCode = 123
+
+///SOURCE_CODE_START_MARKER:tests/neg/magic-offset-header-c.scala
+
+def userCode =
+  val x: String = 0  // anypos-error
diff --git a/tests/neg/magic-offset-header-d_wrapper.check b/tests/neg/magic-offset-header-d_wrapper.check
new file mode 100644
index 000000000000..36421e857a1c
--- /dev/null
+++ b/tests/neg/magic-offset-header-d_wrapper.check
@@ -0,0 +1,15 @@
+original source file not found: something_nonexist.scala
+-- [E007] Type Mismatch Error: tests/neg/magic-offset-header-d_wrapper.scala:3:20 --------------------------------------
+3 |def test1: String = 0 // error
+  |                    ^
+  |                    Found:    (0 : Int)
+  |                    Required: String
+  |
+  | longer explanation available when compiling with `-explain`
+-- [E007] Type Mismatch Error: tests/neg/magic-offset-header-d_wrapper.scala:5:17 --------------------------------------
+5 |def test2: Int = "0" // error
+  |                 ^^^
+  |                 Found:    ("0" : String)
+  |                 Required: Int
+  |
+  | longer explanation available when compiling with `-explain`
diff --git a/tests/neg/magic-offset-header-d_wrapper.scala b/tests/neg/magic-offset-header-d_wrapper.scala
new file mode 100644
index 000000000000..85840e84b702
--- /dev/null
+++ b/tests/neg/magic-offset-header-d_wrapper.scala
@@ -0,0 +1,5 @@
+//> using options -Ymagic-offset-header:SOURCE_CODE_START_MARKER
+
+def test1: String = 0 // error
+///SOURCE_CODE_START_MARKER:something_nonexist.scala
+def test2: Int = "0" // error
diff --git a/tests/run-macros/i22616c.check b/tests/run-macros/i22616c.check
new file mode 100644
index 000000000000..d1918272a8f7
--- /dev/null
+++ b/tests/run-macros/i22616c.check
@@ -0,0 +1 @@
+_B_
diff --git a/tests/run-macros/i22616c/Macro_4.scala b/tests/run-macros/i22616c/Macro_4.scala
new file mode 100644
index 000000000000..02e677db3428
--- /dev/null
+++ b/tests/run-macros/i22616c/Macro_4.scala
@@ -0,0 +1,11 @@
+import scala.quoted.*
+
+object Macro:
+  inline def myMacro[T](): String =
+    ${ myMacroImpl[T]() }
+
+  def myMacroImpl[T: Type]()(using Quotes): Expr[String] =
+    import quotes.reflect.*
+    val myTypeRepr = MyTypeRepr(TypeRepr.of[T])
+    val `caseName`(name) = myTypeRepr.requiredAnnotationValue[caseName]
+    Expr(name)
diff --git a/tests/run-macros/i22616c/MyTypeRepr_3.scala b/tests/run-macros/i22616c/MyTypeRepr_3.scala
new file mode 100644
index 000000000000..1a35889d403d
--- /dev/null
+++ b/tests/run-macros/i22616c/MyTypeRepr_3.scala
@@ -0,0 +1,33 @@
+import scala.quoted.*
+
+final class MyTypeRepr(using val quotes: Quotes)(val unwrap: quotes.reflect.TypeRepr) {
+  import quotes.reflect.*
+
+  def getAnnotation(annotTpe: quotes.reflect.Symbol): Option[quotes.reflect.Term] =
+    unwrap.typeSymbol.getAnnotation(annotTpe)
+
+  def optionalAnnotation[Annot: Type]: Option[Expr[Annot]] = {
+    val annotTpe = TypeRepr.of[Annot]
+    val annotFlags = annotTpe.typeSymbol.flags
+
+    if (annotFlags.is(Flags.Abstract) || annotFlags.is(Flags.Trait))
+      report.errorAndAbort(s"Bad annotation type ${annotTpe.show} is abstract")
+
+    this.getAnnotation(annotTpe.typeSymbol) match
+      case Some(tree) if tree.tpe <:< annotTpe => Some(tree.asExprOf[Annot])
+      case _                                   => None
+  }
+
+  def requiredAnnotation[Annot: Type]: Expr[Annot] =
+    optionalAnnotation[Annot].getOrElse(report.errorAndAbort(s"Missing required annotation `${TypeRepr.of[Annot].show}` for `$this`"))
+
+  def optionalAnnotationValue[Annot: {Type, FromExpr}]: Option[Annot] =
+    optionalAnnotation[Annot].map { expr =>
+      expr.value.getOrElse(report.errorAndAbort(s"Found annotation `${TypeRepr.of[Annot].show}` for `$this`, but are unable to extract Expr.value\n${expr.show}"))
+    }
+
+  def requiredAnnotationValue[Annot: {Type, FromExpr}]: Annot = {
+    val expr = requiredAnnotation[Annot]
+    expr.value.getOrElse(report.errorAndAbort(s"Found annotation `${TypeRepr.of[Annot].show}` for `$this`, but are unable to extract Expr.value\n${expr.show}"))
+  }
+}
diff --git a/tests/run-macros/i22616c/SealedTrait3_2.scala b/tests/run-macros/i22616c/SealedTrait3_2.scala
new file mode 100644
index 000000000000..9141a9ebd08b
--- /dev/null
+++ b/tests/run-macros/i22616c/SealedTrait3_2.scala
@@ -0,0 +1,8 @@
+sealed trait SealedTrait3[+A, +B]
+object SealedTrait3 {
+  final case class AB1[+B, +A](a: B, b: A) extends SealedTrait3[B, A]
+  final case class AB2[+C, +D](a: C, b: D) extends SealedTrait3[D, C]
+  final case class A[+T](a: T) extends SealedTrait3[T, Nothing]
+  @caseName("_B_") final case class B[+T](b: T) extends SealedTrait3[Nothing, T]
+  case object Neither extends SealedTrait3[Nothing, Nothing]
+}
diff --git a/tests/run-macros/i22616c/Test_5.scala b/tests/run-macros/i22616c/Test_5.scala
new file mode 100644
index 000000000000..c8d177a5ae1b
--- /dev/null
+++ b/tests/run-macros/i22616c/Test_5.scala
@@ -0,0 +1,2 @@
+@main def Test =
+  println(Macro.myMacro[SealedTrait3.B[Any]]())
diff --git a/tests/run-macros/i22616c/caseName_1.scala b/tests/run-macros/i22616c/caseName_1.scala
new file mode 100644
index 000000000000..c8fee116e2e9
--- /dev/null
+++ b/tests/run-macros/i22616c/caseName_1.scala
@@ -0,0 +1,14 @@
+import scala.quoted.*
+
+final case class caseName(name: String) extends scala.annotation.Annotation
+object caseName {
+  // This demonstrates a workaround for issue #22616.
+  given FromExpr[caseName] =
+    new FromExpr[caseName] {
+      override def unapply(x: Expr[caseName])(using Quotes): Option[caseName] =
+        x match {
+          case '{ new `caseName`(${ Expr(name) }) } => Some(caseName(name))
+          case _                                    => println(x.show); None
+        }
+    }
+}
diff --git a/tests/run/i23131.scala b/tests/run/i23131.scala
new file mode 100644
index 000000000000..2fdee0d9a618
--- /dev/null
+++ b/tests/run/i23131.scala
@@ -0,0 +1,6 @@
+import scala.NamedTuple
+@main
+def Test =
+  Some((name = "Bob")) match {
+    case Some(name = a) => println(a)
+  }
\ No newline at end of file
