diff --git a/.github/workflows/lts-backport.yaml b/.github/workflows/lts-backport.yaml
index 376b8817b35e..95eabcebfe0c 100644
--- a/.github/workflows/lts-backport.yaml
+++ b/.github/workflows/lts-backport.yaml
@@ -16,7 +16,7 @@ jobs:
         with:
           fetch-depth: 0
       - uses: coursier/cache-action@v6
-      - uses: VirtusLab/scala-cli-setup@v1.8.4
+      - uses: VirtusLab/scala-cli-setup@v1.8.5
       - run: scala-cli ./project/scripts/addToBackportingProject.scala -- ${{ github.sha }}
         env:
           GRAPHQL_API_TOKEN: ${{ secrets.GRAPHQL_API_TOKEN }}
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/changelogs/3.7.3-RC2.md b/changelogs/3.7.3-RC2.md
new file mode 100644
index 000000000000..243d06b5348d
--- /dev/null
+++ b/changelogs/3.7.3-RC2.md
@@ -0,0 +1,29 @@
+# Backported chnages
+
+- Warn if implicit default shadows given [#23559](https://github.com/scala/scala3/pull/23559)
+- Bump Scala CLI to v1.8.5 (was v1.8.4) [#23702](https://github.com/scala/scala3/pull/23702)
+- Fix issue with pc breaking in requiredMethod on newly overloaded valueOf [#23708](https://github.com/scala/scala3/pull/23708)
+- Handle default arguments in named parameters for inlay hints [#23641](https://github.com/scala/scala3/pull/23641)
+- Add suppression if nowarn differs [#23652](https://github.com/scala/scala3/pull/23652)
+- Fix match type bounds checking problem [#23695](https://github.com/scala/scala3/pull/23695)
+- Generalize "Don't approximate a type using Nothing as prefix" [#23628](https://github.com/scala/scala3/pull/23628)
+- More careful ClassTag instantiation [#23659](https://github.com/scala/scala3/pull/23659)
+- Use more context for implicit search only if no default argument [#23664](https://github.com/scala/scala3/pull/23664)
+- Fix extracting refinements from intersection types in dynamic select hovers [#23640](https://github.com/scala/scala3/pull/23640)
+
+# Contributors
+
+Thank you to all the contributors who made this release possible 🎉
+
+According to `git shortlog -sn --no-merges 3.7.3-RC1..3.7.3-RC2` these are:
+
+```
+  5  Martin Odersky
+  4  Som Snytt
+  2  Wojciech Mazur
+  1  Guillaume Martres
+  1  Jan Chyb
+  1  Kacper Korban
+  1  Piotr Chabelski
+  1  aherlihy
+```
diff --git a/compiler/src/dotty/tools/dotc/Run.scala b/compiler/src/dotty/tools/dotc/Run.scala
index a9f0c677e17f..58ea3e03edba 100644
--- a/compiler/src/dotty/tools/dotc/Run.scala
+++ b/compiler/src/dotty/tools/dotc/Run.scala
@@ -92,14 +92,21 @@ extends ImplicitRunInfo, ConstraintRunInfo, cc.CaptureRunInfo {
       mySuspendedMessages.getOrElseUpdate(warning.pos.source, mutable.LinkedHashSet.empty) += warning
 
     def nowarnAction(dia: Diagnostic): Action.Warning.type | Action.Verbose.type | Action.Silent.type =
-      mySuppressions.getOrElse(dia.pos.source, Nil).find(_.matches(dia)) match {
-        case Some(s) =>
+      mySuppressions.get(dia.pos.source) match
+      case Some(suppressions) =>
+        val matching = suppressions.iterator.filter(_.matches(dia))
+        if matching.hasNext then
+          val s = matching.next()
+          for other <- matching do
+            if !other.used then
+              other.markSuperseded() // superseded unless marked used later
           s.markUsed()
-          if (s.verbose) Action.Verbose
+          if s.verbose then Action.Verbose
           else Action.Silent
-        case _ =>
+        else
           Action.Warning
-      }
+      case none =>
+        Action.Warning
 
     def registerNowarn(annotPos: SourcePosition, range: Span)(conf: String, pos: SrcPos)(using Context): Unit =
       var verbose = false
@@ -118,12 +125,10 @@ extends ImplicitRunInfo, ConstraintRunInfo, cc.CaptureRunInfo {
           .merge
       addSuppression:
         Suppression(annotPos, filters, range.start, range.end, verbose)
-          .tap: sup =>
-            if filters == List(MessageFilter.None) then sup.markUsed() // invalid suppressions, don't report as unused
 
     def addSuppression(sup: Suppression): Unit =
       val suppressions = mySuppressions.getOrElseUpdate(sup.annotPos.source, ListBuffer.empty)
-      if sup.start != sup.end && suppressions.forall(x => x.start != sup.start || x.end != sup.end) then
+      if sup.start != sup.end then
         suppressions += sup
 
     def reportSuspendedMessages(source: SourceFile)(using Context): Unit = {
@@ -134,7 +139,8 @@ extends ImplicitRunInfo, ConstraintRunInfo, cc.CaptureRunInfo {
       mySuspendedMessages.remove(source).foreach(_.foreach(ctx.reporter.issueIfNotSuppressed))
     }
 
-    def runFinished(hasErrors: Boolean): Unit =
+    def runFinished()(using Context): Unit =
+      val hasErrors = ctx.reporter.hasErrors
       // report suspended messages (in case the run finished before typer)
       mySuspendedMessages.keysIterator.toList.foreach(reportSuspendedMessages)
       // report unused nowarns only if all all phases are done
@@ -142,10 +148,16 @@ extends ImplicitRunInfo, ConstraintRunInfo, cc.CaptureRunInfo {
         for
           source <- mySuppressions.keysIterator.toList
           sups   <- mySuppressions.remove(source)
-          sup    <- sups.reverse
-          if !sup.used
         do
-          report.warning("@nowarn annotation does not suppress any warnings", sup.annotPos)
+          val suppressions = sups.reverse.toList
+          for sup <- suppressions do
+            if !sup.used
+            && !suppressions.exists(s => s.ne(sup) && s.used && s.annotPos == sup.annotPos) // duplicate
+            && sup.filters != List(MessageFilter.None) // invalid suppression, don't report as unused
+            then
+              val more = if sup.superseded then " but matches a diagnostic" else ""
+              report.warning("@nowarn annotation does not suppress any warnings"+more, sup.annotPos)
+  end suppressions
 
   /** The compilation units currently being compiled, this may return different
    *  results over time.
@@ -411,7 +423,7 @@ extends ImplicitRunInfo, ConstraintRunInfo, cc.CaptureRunInfo {
     ctx.reporter.finalizeReporting()
     if (!ctx.reporter.hasErrors)
       Rewrites.writeBack()
-    suppressions.runFinished(hasErrors = ctx.reporter.hasErrors)
+    suppressions.runFinished()
     while (finalizeActions.nonEmpty && canProgress()) {
       val action = finalizeActions.remove(0)
       action()
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..a2c557ea2987 100644
--- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
+++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
@@ -167,6 +167,7 @@ private sealed trait WarningSettings:
   private val WimplausiblePatterns = BooleanSetting(WarningSetting, "Wimplausible-patterns", "Warn if comparison with a pattern value looks like it might always fail.")
   private val WunstableInlineAccessors = BooleanSetting(WarningSetting, "WunstableInlineAccessors", "Warn an inline methods has references to non-stable binary APIs.")
   private val WtoStringInterpolated = BooleanSetting(WarningSetting, "Wtostring-interpolated", "Warn a standard interpolator used toString on a reference type.")
+  private val WrecurseWithDefault = BooleanSetting(WarningSetting, "Wrecurse-with-default", "Warn when a method calls itself with a default argument.")
   private val Wunused: Setting[List[ChoiceWithHelp[String]]] = MultiChoiceHelpSetting(
     WarningSetting,
     name = "Wunused",
@@ -309,6 +310,7 @@ private sealed trait WarningSettings:
     def implausiblePatterns(using Context): Boolean = allOr(WimplausiblePatterns)
     def unstableInlineAccessors(using Context): Boolean = allOr(WunstableInlineAccessors)
     def toStringInterpolated(using Context): Boolean = allOr(WtoStringInterpolated)
+    def recurseWithDefault(using Context): Boolean = allOr(WrecurseWithDefault)
     def checkInit(using Context): Boolean = allOr(WcheckInit)
 
 /** -X "Extended" or "Advanced" settings */
@@ -444,6 +446,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/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala
index a6f59d8b2d33..7fac8c818a1a 100644
--- a/compiler/src/dotty/tools/dotc/core/Types.scala
+++ b/compiler/src/dotty/tools/dotc/core/Types.scala
@@ -6507,7 +6507,7 @@ object Types extends TypeUtils {
     protected def range(lo: Type, hi: Type): Type =
       if variance > 0 then hi
       else if variance < 0 then
-        if (lo eq defn.NothingType) && hi.hasSimpleKind then
+        if (lo eq defn.NothingType) then
           // Approximate by Nothing & hi instead of just Nothing, in case the
           // approximated type is used as the prefix of another type (this would
           // lead to a type with a `NoDenotation` denot and a possible
@@ -6518,8 +6518,14 @@ object Types extends TypeUtils {
           // example if Nothing is the type of a parameter being depended on in
           // a MethodType)
           //
-          // Test case in tests/pos/i23530.scala
-          AndType(lo, hi)
+          // Test case in tests/pos/i23530.scala (and tests/pos/i23627.scala for
+          // the higher-kinded case which requires eta-expansion)
+          hi.etaExpand match
+            case expandedHi: HKTypeLambda =>
+              expandedHi.derivedLambdaType(resType = AndType(lo, expandedHi.resType))
+            case _ =>
+              // simple-kinded case
+              AndType(lo, hi)
         else
           lo
       else if lo `eq` hi then lo
diff --git a/compiler/src/dotty/tools/dotc/reporting/ErrorMessageID.scala b/compiler/src/dotty/tools/dotc/reporting/ErrorMessageID.scala
index 2dedcd788ec4..103687abdbff 100644
--- a/compiler/src/dotty/tools/dotc/reporting/ErrorMessageID.scala
+++ b/compiler/src/dotty/tools/dotc/reporting/ErrorMessageID.scala
@@ -232,6 +232,9 @@ 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
+  case DefaultShadowsGivenID // errorNumber: 220
+  case RecurseWithDefaultID // errorNumber: 221
 
   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/WConf.scala b/compiler/src/dotty/tools/dotc/reporting/WConf.scala
index ac25f2f6cd30..cff15aa6dc38 100644
--- a/compiler/src/dotty/tools/dotc/reporting/WConf.scala
+++ b/compiler/src/dotty/tools/dotc/reporting/WConf.scala
@@ -10,6 +10,7 @@ import dotty.tools.dotc.interfaces.SourceFile
 import dotty.tools.dotc.reporting.MessageFilter.SourcePattern
 
 import java.util.regex.PatternSyntaxException
+import scala.PartialFunction.cond
 import scala.annotation.internal.sharable
 import scala.util.matching.Regex
 
@@ -136,13 +137,20 @@ object WConf:
       if (parseErrorss.nonEmpty) Left(parseErrorss.flatten)
       else Right(WConf(configs))
 
-class Suppression(val annotPos: SourcePosition, filters: List[MessageFilter], val start: Int, val end: Int, val verbose: Boolean):
-  private var _used = false
-  def used: Boolean = _used
+class Suppression(val annotPos: SourcePosition, val filters: List[MessageFilter], val start: Int, val end: Int, val verbose: Boolean):
+  inline def unusedState = 0
+  inline def usedState = 1
+  inline def supersededState = 2
+  private var _used = unusedState
+  def used: Boolean = _used == usedState
+  def superseded: Boolean = _used == supersededState
   def markUsed(): Unit =
-    _used = true
+    _used = usedState
+  def markSuperseded(): Unit =
+    _used = supersededState
   def matches(dia: Diagnostic): Boolean =
     val pos = dia.pos
     pos.exists && start <= pos.start && pos.end <= end && filters.forall(_.matches(dia))
 
   override def toString = s"Suppress in ${annotPos.source} $start..$end [${filters.mkString(", ")}]"
+end Suppression
diff --git a/compiler/src/dotty/tools/dotc/reporting/messages.scala b/compiler/src/dotty/tools/dotc/reporting/messages.scala
index eb5e692b2915..210322841158 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,
@@ -3652,3 +3664,15 @@ final class IllegalErasedDef(sym: Symbol)(using Context) extends TypeMsg(Illegal
   override protected def explain(using Context): String =
     "Only non-lazy immutable values can be `erased`"
 end IllegalErasedDef
+
+final class DefaultShadowsGiven(name: Name)(using Context) extends TypeMsg(DefaultShadowsGivenID):
+  override protected def msg(using Context): String =
+    i"Argument for implicit parameter $name was supplied using a default argument."
+  override protected def explain(using Context): String =
+    "Usually the given in scope is intended, but you must specify it after explicit `using`."
+
+final class RecurseWithDefault(name: Name)(using Context) extends TypeMsg(RecurseWithDefaultID):
+  override protected def msg(using Context): String =
+    i"Recursive call used a default argument for parameter $name."
+  override protected def explain(using Context): String =
+    "It's more explicit to pass current or modified arguments in a recursion."
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..8bf88a0027c4 100644
--- a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala
+++ b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala
@@ -267,8 +267,14 @@ object PatternMatcher {
         def matchArgsPatternPlan(args: List[Tree], syms: List[Symbol]): Plan =
           args match {
             case arg :: args1 =>
-              val sym :: syms1 = syms: @unchecked
-              patternPlan(sym, arg, matchArgsPatternPlan(args1, syms1))
+              if (args.length != syms.length)
+                report.error(UnapplyInvalidNumberOfArguments(tree, tree.tpe :: Nil), arg.srcPos)
+                // Generate a throwaway but type-correct plan.
+                // This plan will never execute because it'll be guarded by a `NonNullTest`.
+                ResultPlan(tpd.Throw(tpd.nullLiteral))
+              else
+                val sym :: syms1 = syms: @unchecked
+                patternPlan(sym, arg, matchArgsPatternPlan(args1, syms1))
             case Nil =>
               assert(syms.isEmpty)
               onSuccess
@@ -343,7 +349,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 +388,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 +398,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 +405,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/TailRec.scala b/compiler/src/dotty/tools/dotc/transform/TailRec.scala
index 08c2c6a015c0..690a180e52ca 100644
--- a/compiler/src/dotty/tools/dotc/transform/TailRec.scala
+++ b/compiler/src/dotty/tools/dotc/transform/TailRec.scala
@@ -4,9 +4,9 @@ package transform
 import ast.{TreeTypeMap, tpd}
 import config.Printers.tailrec
 import core.*
-import Contexts.*, Flags.*, Symbols.*, Decorators.em
+import Contexts.*, Flags.*, Symbols.*, Decorators.*
 import Constants.Constant
-import NameKinds.{TailLabelName, TailLocalName, TailTempName}
+import NameKinds.{DefaultGetterName, TailLabelName, TailLocalName, TailTempName}
 import StdNames.nme
 import reporting.*
 import transform.MegaPhase.MiniPhase
@@ -325,7 +325,14 @@ class TailRec extends MiniPhase {
           method.matches(calledMethod) &&
           enclosingClass.appliedRef.widen <:< prefix.tpe.widenDealias
 
-        if (isRecursiveCall)
+        if isRecursiveCall then
+          if ctx.settings.Whas.recurseWithDefault then
+            tree.args.find(_.symbol.name.is(DefaultGetterName)) match
+            case Some(arg) =>
+              val DefaultGetterName(_, index) = arg.symbol.name: @unchecked
+              report.warning(RecurseWithDefault(calledMethod.info.firstParamNames(index)), tree.srcPos)
+            case _ =>
+
           if (inTailPosition) {
             tailrec.println("Rewriting tail recursive call:  " + tree.span)
             rewrote = true
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/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala
index da6b20b75c29..290e061772e4 100644
--- a/compiler/src/dotty/tools/dotc/typer/Applications.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala
@@ -774,6 +774,11 @@ trait Applications extends Compatibility {
               methodType.isImplicitMethod && (applyKind == ApplyKind.Using || failEmptyArgs)
 
             if !defaultArg.isEmpty then
+              if methodType.isImplicitMethod && ctx.mode.is(Mode.ImplicitsEnabled)
+              && !inferImplicitArg(formal, appPos.span).tpe.isError
+              then
+                report.warning(DefaultShadowsGiven(methodType.paramNames(n)), appPos)
+
               defaultArg.tpe.widen match
                 case _: MethodOrPoly if testOnly => matchArgs(args1, formals1, n + 1)
                 case _ => matchArgs(args1, addTyped(treeToArg(defaultArg)), n + 1)
diff --git a/compiler/src/dotty/tools/dotc/typer/Checking.scala b/compiler/src/dotty/tools/dotc/typer/Checking.scala
index ceec2392af1a..ecbb34ea2949 100644
--- a/compiler/src/dotty/tools/dotc/typer/Checking.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Checking.scala
@@ -145,22 +145,26 @@ object Checking {
     val checker = new TypeTraverser:
       def traverse(tp: Type) =
         tp match
-          case AppliedType(tycon, argTypes)
-          if !(tycon.typeSymbol.is(JavaDefined) && ctx.compilationUnit.isJava)
-            // Don't check bounds in Java units that refer to Java type constructors.
-            // Scala is not obliged to do Java type checking and in fact i17763 goes wrong
-            // if we attempt to check bounds of F-bounded mutually recursive Java interfaces.
-            // Do check all bounds in Scala units and those bounds in Java units that
-            // occur in applications of Scala type constructors.
-            && !isCaptureChecking || tycon.typeSymbol.is(CaptureChecked)
-            // Don't check bounds when capture checking type constructors that were not
-            // themselves capture checked. Since the type constructor could not foresee
-            // possible capture sets, it's better to be lenient for backwards compatibility.
-          =>
-            checkAppliedType(
-              untpd.AppliedTypeTree(TypeTree(tycon), argTypes.map(TypeTree(_)))
-                .withType(tp).withSpan(tpt.span.toSynthetic),
-              tpt)
+          case tp @ AppliedType(tycon, argTypes) =>
+            // Should the type be re-checked in the CC phase?
+            // Exempted are types that are not themselves capture-checked.
+            // Since the type constructor could not foresee possible capture sets,
+            // it's better to be lenient for backwards compatibility.
+            // Also exempted are match aliases. See tuple-ops.scala for an example that
+            // would fail otherwise.
+            def checkableUnderCC =
+              tycon.typeSymbol.is(CaptureChecked) && !tp.isMatchAlias
+            if !(tycon.typeSymbol.is(JavaDefined) && ctx.compilationUnit.isJava)
+                // Don't check bounds in Java units that refer to Java type constructors.
+                // Scala is not obliged to do Java type checking and in fact i17763 goes wrong
+                // if we attempt to check bounds of F-bounded mutually recursive Java interfaces.
+                // Do check all bounds in Scala units and those bounds in Java units that
+                // occur in applications of Scala type constructors.
+                && (!isCaptureChecking || checkableUnderCC) then
+              checkAppliedType(
+                untpd.AppliedTypeTree(TypeTree(tycon), argTypes.map(TypeTree(_)))
+                  .withType(tp).withSpan(tpt.span.toSynthetic),
+                tpt)
           case _ =>
         traverseChildren(tp)
     checker.traverse(tpt.tpe)
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/Synthesizer.scala b/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala
index 8df2fc1ed4b7..0c35d0377e51 100644
--- a/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala
@@ -20,6 +20,7 @@ import ast.tpd.*
 import Synthesizer.*
 import sbt.ExtractDependencies.*
 import xsbti.api.DependencyContext.*
+import TypeComparer.{fullLowerBound, fullUpperBound}
 
 /** Synthesize terms for special classes */
 class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
@@ -38,10 +39,32 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
         // bounds are usually widened during instantiation.
         instArg(tp.tp1)
       case tvar: TypeVar if ctx.typerState.constraint.contains(tvar) =>
+      	// If tvar has a lower or upper bound:
+      	//   1. If the bound is not another type variable, use this as approximation.
+      	//   2. Otherwise, if the type can be forced to be fully defined, use that type
+      	//      as approximation.
+      	//   3. Otherwise leave argument uninstantiated.
+      	// The reason for (2) is that we observed complicated constraints in i23611.scala
+      	// that get better types if a fully defined type is computed than if several type
+      	// variables are approximated incrementally. This is a minimization of some ZIO code.
+      	// So in order to keep backwards compatibility (where before we _only_ did 2) we
+      	// add that special case.
+        def isGroundConstr(tp: Type): Boolean = tp.dealias match
+          case tvar: TypeVar if ctx.typerState.constraint.contains(tvar) => false
+          case pref: TypeParamRef if ctx.typerState.constraint.contains(pref) => false
+          case tp: AndOrType => isGroundConstr(tp.tp1) && isGroundConstr(tp.tp2)
+          case _ => true
         instArg(
-            if tvar.hasLowerBound then tvar.instantiate(fromBelow = true)
-            else if tvar.hasUpperBound then tvar.instantiate(fromBelow = false)
-            else NoType)
+            if tvar.hasLowerBound then
+              if isGroundConstr(fullLowerBound(tvar.origin)) then tvar.instantiate(fromBelow = true)
+              else if isFullyDefined(tp, ForceDegree.all) then tp
+              else NoType
+            else if tvar.hasUpperBound then
+              if isGroundConstr(fullUpperBound(tvar.origin)) then tvar.instantiate(fromBelow = false)
+              else if isFullyDefined(tp, ForceDegree.all) then tp
+              else NoType
+            else
+              NoType)
       case _ =>
         tp
 
@@ -569,9 +592,8 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
                   resType <:< target
                   val tparams = poly.paramRefs
                   val variances = childClass.typeParams.map(_.paramVarianceSign)
-                  val instanceTypes = tparams.lazyZip(variances).map((tparam, variance) =>
+                  val instanceTypes = tparams.lazyZip(variances).map: (tparam, variance) =>
                     TypeComparer.instanceType(tparam, fromBelow = variance < 0, Widen.Unions)
-                  )
                   val instanceType = resType.substParams(poly, instanceTypes)
                   // this is broken in tests/run/i13332intersection.scala,
                   // because type parameters are not correctly inferred.
diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala
index 10a061ab8fc4..e9e3e22342bf 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))
@@ -4359,11 +4362,17 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
 
             val arg = inferImplicitArg(formal, tree.span.endPos)
 
+            lazy val defaultArg = findDefaultArgument(argIndex)
+              .showing(i"default argument: for $formal, $tree, $argIndex = $result", typr)
+            def argHasDefault = hasDefaultParams && !defaultArg.isEmpty
+
             def canProfitFromMoreConstraints =
               arg.tpe.isInstanceOf[AmbiguousImplicits]
-                    // ambiguity could be decided by more constraints
-              || !isFullyDefined(formal, ForceDegree.none)
-                    // more context might constrain type variables which could make implicit scope larger
+                    // Ambiguity could be decided by more constraints
+              || !isFullyDefined(formal, ForceDegree.none) && !argHasDefault
+                    // More context might constrain type variables which could make implicit scope larger.
+                    // But in this case we should search with additional arguments typed only if there
+                    // is no default argument.
 
             arg.tpe match
               case failed: SearchFailureType if canProfitFromMoreConstraints =>
@@ -4376,15 +4385,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
               case failed: AmbiguousImplicits =>
                 arg :: implicitArgs(formals1, argIndex + 1, pt)
               case failed: SearchFailureType =>
-                lazy val defaultArg = findDefaultArgument(argIndex)
-                  .showing(i"default argument: for $formal, $tree, $argIndex = $result", typr)
-                if !hasDefaultParams || defaultArg.isEmpty then
-                  // no need to search further, the adapt fails in any case
-                  // the reason why we continue inferring arguments in case of an AmbiguousImplicits
-                  // is that we need to know whether there are further errors.
-                  // If there are none, we have to propagate the ambiguity to the caller.
-                  arg :: formals1.map(dummyArg)
-                else
+                if argHasDefault then
                   // This is tricky. On the one hand, we need the defaultArg to
                   // correctly type subsequent formal parameters in the same using
                   // clause in case there are parameter dependencies. On the other hand,
@@ -4395,6 +4396,12 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
                   // `if propFail.exists` where we re-type the whole using clause with named
                   // arguments for all implicits that were found.
                   arg :: inferArgsAfter(defaultArg)
+                else
+                  // no need to search further, the adapt fails in any case
+                  // the reason why we continue inferring arguments in case of an AmbiguousImplicits
+                  // is that we need to know whether there are further errors.
+                  // If there are none, we have to propagate the ambiguity to the caller.
+                  arg :: formals1.map(dummyArg)
               case _ =>
                 arg :: inferArgsAfter(arg)
         end implicitArgs
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/HoverProvider.scala b/presentation-compiler/src/main/dotty/tools/pc/HoverProvider.scala
index c55a8a0210be..375a75d0307f 100644
--- a/presentation-compiler/src/main/dotty/tools/pc/HoverProvider.scala
+++ b/presentation-compiler/src/main/dotty/tools/pc/HoverProvider.scala
@@ -13,6 +13,7 @@ import scala.meta.pc.SymbolSearch
 import dotty.tools.dotc.ast.tpd.*
 import dotty.tools.dotc.core.Constants.*
 import dotty.tools.dotc.core.Contexts.*
+import dotty.tools.dotc.core.Decorators.*
 import dotty.tools.dotc.core.Flags.*
 import dotty.tools.dotc.core.Names.*
 import dotty.tools.dotc.core.StdNames.*
@@ -221,12 +222,21 @@ object HoverProvider:
             findRefinement(parent)
           case _ => None
 
-      val refTpe = sel.typeOpt.widen.deepDealiasAndSimplify match
-        case r: RefinedType => Some(r)
-        case t: (TermRef | TypeProxy) => Some(t.termSymbol.info.deepDealiasAndSimplify)
-        case _ => None
+      def extractRefinements(t: Type): List[Type] = t match
+        case r: RefinedType => List(r)
+        case t: (TypeRef | AppliedType) =>
+          // deepDealiasAndSimplify can succeed with no progress, so we have to avoid infinite loops
+          val t1 = t.deepDealiasAndSimplify
+          if t1 == t then Nil
+          else extractRefinements(t1)
+        case t: TermRef => extractRefinements(t.widen)
+        case t: TypeProxy => List(t.termSymbol.info.deepDealiasAndSimplify)
+        case AndType(l , r) => List(extractRefinements(l), extractRefinements(r)).flatten
+        case _ => Nil
 
-      refTpe.flatMap(findRefinement).asJava
+      val refTpe: List[Type] = extractRefinements(sel.typeOpt)
+
+      refTpe.flatMap(findRefinement).headOption.asJava
     case _ =>
       ju.Optional.empty().nn
 
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/src/main/dotty/tools/pc/completions/Completions.scala b/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala
index e7902ef8aa44..b396dd780cc0 100644
--- a/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala
+++ b/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala
@@ -734,15 +734,18 @@ class Completions(
     defn.Object_notifyAll,
     defn.Object_notify,
     defn.Predef_undefined,
-    defn.ObjectClass.info.member(nme.wait_).symbol,
     // NOTE(olafur) IntelliJ does not complete the root package and without this filter
     // then `_root_` would appear as a completion result in the code `foobar(_<COMPLETE>)`
     defn.RootPackage,
     // NOTE(gabro) valueOf was added as a Predef member in 2.13. We filter it out since is a niche
     // use case and it would appear upon typing 'val'
-    defn.ValueOfClass.info.member(nme.valueOf).symbol,
-    defn.ScalaPredefModule.requiredMethod(nme.valueOf)
-  ).flatMap(_.alternatives.map(_.symbol)).toSet
+    defn.ValueOfClass
+  ) ++ (
+    Set(
+      defn.ObjectClass.info.member(nme.wait_),
+      defn.ScalaPredefModule.info.member(nme.valueOf)
+    ).flatMap(_.alternatives.map(_.symbol)).toSet
+  )
 
   private def isNotLocalForwardReference(sym: Symbol)(using Context): Boolean =
     !sym.isLocalToBlock ||
diff --git a/presentation-compiler/test/dotty/tools/pc/tests/completion/CompletionSuite.scala b/presentation-compiler/test/dotty/tools/pc/tests/completion/CompletionSuite.scala
index 05037cffca94..277a579ba4ce 100644
--- a/presentation-compiler/test/dotty/tools/pc/tests/completion/CompletionSuite.scala
+++ b/presentation-compiler/test/dotty/tools/pc/tests/completion/CompletionSuite.scala
@@ -129,9 +129,6 @@ class CompletionSuite extends BaseCompletionSuite:
          |isInstanceOf[X0]: Boolean
          |synchronized[X0](x$0: X0): X0
          |toString(): String
-         |wait(): Unit
-         |wait(x$0: Long): Unit
-         |wait(x$0: Long, x$1: Int): Unit
          |""".stripMargin
     )
 
diff --git a/presentation-compiler/test/dotty/tools/pc/tests/hover/HoverTermSuite.scala b/presentation-compiler/test/dotty/tools/pc/tests/hover/HoverTermSuite.scala
index c483dc289b0e..60827f1e3590 100644
--- a/presentation-compiler/test/dotty/tools/pc/tests/hover/HoverTermSuite.scala
+++ b/presentation-compiler/test/dotty/tools/pc/tests/hover/HoverTermSuite.scala
@@ -851,3 +851,78 @@ class HoverTermSuite extends BaseHoverSuite:
          |""".stripMargin,
       "val thisIsAVeryLongName: Int".hover
     )
+
+  @Test def `intersection_of_selectable-1` =
+    check(
+      """|class Record extends Selectable:
+         |  def selectDynamic(name: String): Any = ???
+         |
+         |type A = Record { val aa: Int }
+         |type B = Record { val bb: String }
+         |type AB = A & B
+         |
+         |val ab: AB = Record().asInstanceOf[AB]
+         |val ab_a = ab.a@@a
+         |""".stripMargin,
+      "val aa: Int".hover
+    )
+
+  @Test def `intersection_of_selectable-2` =
+    check(
+      """|class Record extends Selectable:
+         |  def selectDynamic(name: String): Any = ???
+         |
+         |type A = Record { val aa: Int }
+         |type B = Record { val aa: String }
+         |type AB = A & B
+         |
+         |val ab: AB = Record().asInstanceOf[AB]
+         |val ab_a = ab.a@@a
+         |""".stripMargin,
+      "val aa: Int & String".hover
+    )
+
+  @Test def `intersection_of_selectable-3` =
+    check(
+      """|class Record extends Selectable:
+         |  def selectDynamic(name: String): Any = ???
+         |
+         |type A = Record { val aa: Int }
+         |type B = Record { val bb: String }
+         |type AB = A & B
+         |
+         |val ab: AB = Record().asInstanceOf[AB]
+         |val ab_a = ab.b@@b
+         |""".stripMargin,
+      "val bb: String".hover
+    )
+
+  @Test def `intersection_of_selectable-4` =
+    check(
+      """|class Record extends Selectable:
+         |  def selectDynamic(name: String): Any = ???
+         |
+         |type A = Record { val aa: Int }
+         |type B = Record { val bb: String }
+         |type C = Record { val cc: Float }
+         |type AB = A & B
+         |type ABC = AB & C
+         |
+         |val abc: ABC = Record().asInstanceOf[ABC]
+         |val abc_a = abc.a@@a
+         |""".stripMargin,
+      "val aa: Int".hover
+    )
+
+  @Test def `intersection_of_selectable-5` =
+    check(
+      """|class Record extends Selectable:
+         |  def selectDynamic(name: String): Any = ???
+         |
+         |type AL = List[Int] & Record { val aa: Int }
+         |
+         |val al: AL = ???.asInstanceOf[ABC]
+         |val al_a = al.a@@a
+         |""".stripMargin,
+      "val aa: Int".hover
+    )
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..07f7164de438 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
@@ -72,7 +72,7 @@ object Build {
    *  During release candidate cycle incremented by the release officer before publishing a subsequent RC version;
    *  During final, stable release is set exactly to `developedVersion`.
   */
-  val baseVersion = s"$developedVersion-RC1"
+  val baseVersion = s"$developedVersion-RC2"
 
   /** The version of TASTY that should be emitted, checked in runtime test
    *  For defails on how TASTY version should be set see related discussions:
@@ -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. */
@@ -137,7 +137,7 @@ object Build {
   val mimaPreviousLTSDottyVersion = "3.3.0"
 
   /** Version of Scala CLI to download */
-  val scalaCliLauncherVersion = "1.8.4"
+  val scalaCliLauncherVersion = "1.8.5"
   /** Version of Coursier to download for initializing the local maven repo of Scala command */
   val coursierJarVersion = "2.1.24"
 
diff --git a/scaladoc/src/dotty/tools/scaladoc/tasty/TypesSupport.scala b/scaladoc/src/dotty/tools/scaladoc/tasty/TypesSupport.scala
index 30a5ac22be0d..24473c874c96 100644
--- a/scaladoc/src/dotty/tools/scaladoc/tasty/TypesSupport.scala
+++ b/scaladoc/src/dotty/tools/scaladoc/tasty/TypesSupport.scala
@@ -1,13 +1,13 @@
 package dotty.tools.scaladoc
 package tasty
 
-import scala.jdk.CollectionConverters._
-
-import scala.quoted._
+import scala.annotation.*
+import scala.jdk.CollectionConverters.*
+import scala.quoted.*
 import scala.util.control.NonFatal
 
-import NameNormalizer._
-import SyntheticsSupport._
+import NameNormalizer.*
+import SyntheticsSupport.*
 
 trait TypesSupport:
   self: TastyParser =>
@@ -155,24 +155,25 @@ trait TypesSupport:
             .reduceLeftOption((acc: SSignature, elem: SSignature) => acc ++ plain(", ").l ++ elem).getOrElse(List())
           ++ plain(")").l
 
-        def parseRefinedElem(name: String, info: TypeRepr, polyTyped: SSignature = Nil): SSignature = ( info match {
+        def parseRefinedElem(name: String, info: TypeRepr, polyTyped: SSignature = Nil): SSignature =
+          val ssig = info match
           case m: MethodType => {
             val paramList = getParamList(m)
             keyword("def ").l ++ plain(name).l ++ polyTyped ++ paramList ++ plain(": ").l ++ inner(m.resType, skipThisTypePrefix)
           }
-          case t: PolyType => {
+          case t: PolyType =>
             val paramBounds = getParamBounds(t)
-            val parsedMethod = parseRefinedElem(name, t.resType)
-            if (!paramBounds.isEmpty){
+            if !paramBounds.isEmpty then
               parseRefinedElem(name, t.resType, plain("[").l ++ paramBounds ++ plain("]").l)
-            } else parseRefinedElem(name, t.resType)
-          }
+            else
+              parseRefinedElem(name, t.resType, polyTyped = Nil)
           case ByNameType(tp) => keyword("def ").l ++ plain(s"$name: ").l ++ inner(tp, skipThisTypePrefix)
           case t: TypeBounds => keyword("type ").l ++ plain(name).l ++ inner(t, skipThisTypePrefix)
           case t: TypeRef => keyword("val ").l ++ plain(s"$name: ").l ++ inner(t, skipThisTypePrefix)
           case t: TermRef => keyword("val ").l ++ plain(s"$name: ").l ++ inner(t, skipThisTypePrefix)
           case other => noSupported(s"Not supported type in refinement $info")
-        } ) ++ plain("; ").l
+
+          ssig ++ plain("; ").l
 
         def parsePolyFunction(info: TypeRepr): SSignature = info match {
           case t: PolyType =>
@@ -253,6 +254,7 @@ trait TypesSupport:
         }) ++ plain("]").l
 
       case tp @ TypeRef(qual, typeName) =>
+        inline def wrapping = shouldWrapInParens(inner = qual, outer = tp, isLeft = true)
         qual match {
           case r: RecursiveThis => tpe(s"this.$typeName").l
           case ThisType(tr) =>
@@ -269,23 +271,28 @@ trait TypesSupport:
               if skipPrefix(qual, elideThis, originalOwner, skipThisTypePrefix) then
                 tpe(tp.typeSymbol)
               else
-                val sig = inParens(inner(qual, skipThisTypePrefix)(using skipTypeSuffix = true), shouldWrapInParens(qual, tp, true))
-                sig ++ plain(".").l ++ tpe(tp.typeSymbol)
+                val sig = inParens(
+                  inner(qual, skipThisTypePrefix)(using indent = indent, skipTypeSuffix = true), wrapping)
+                   sig
+                ++ plain(".").l
+                ++ tpe(tp.typeSymbol)
 
           case t if skipPrefix(t, elideThis, originalOwner, skipThisTypePrefix) =>
             tpe(tp.typeSymbol)
           case _: TermRef | _: ParamRef =>
             val suffix = if tp.typeSymbol == Symbol.noSymbol then tpe(typeName).l else tpe(tp.typeSymbol)
-            inner(qual, skipThisTypePrefix)(using skipTypeSuffix = true) ++ plain(".").l ++ suffix
+               inner(qual, skipThisTypePrefix)(using indent = indent, skipTypeSuffix = true)
+            ++ plain(".").l
+            ++ suffix
           case _ =>
-            val sig = inParens(inner(qual, skipThisTypePrefix), shouldWrapInParens(qual, tp, true))
+            val sig = inParens(inner(qual, skipThisTypePrefix), wrapping)
             sig ++ keyword("#").l ++ tpe(tp.typeSymbol)
         }
 
       case tr @ TermRef(qual, typeName) =>
         val prefix = qual match
           case t if skipPrefix(t, elideThis, originalOwner, skipThisTypePrefix) => Nil
-          case tp => inner(tp, skipThisTypePrefix)(using skipTypeSuffix = true) ++ plain(".").l
+          case tp => inner(tp, skipThisTypePrefix)(using indent = indent, skipTypeSuffix = true) ++ plain(".").l
         val suffix = if skipTypeSuffix then Nil else List(plain("."), keyword("type"))
         val typeSig = tr.termSymbol.tree match
           case vd: ValDef if tr.termSymbol.flags.is(Flags.Module) =>
@@ -304,9 +311,17 @@ trait TypesSupport:
         val spaces = " " * (indent)
         val casesTexts = cases.flatMap {
           case MatchCase(from, to) =>
-            keyword(caseSpaces + "case ").l ++ inner(from, skipThisTypePrefix) ++ keyword(" => ").l ++ inner(to, skipThisTypePrefix)(using indent = indent + 2) ++ plain("\n").l
+               keyword(caseSpaces + "case ").l
+            ++ inner(from, skipThisTypePrefix)
+            ++ keyword(" => ").l
+            ++ inner(to, skipThisTypePrefix)(using indent = indent + 2, skipTypeSuffix = skipTypeSuffix)
+            ++ plain("\n").l
           case TypeLambda(_, _, MatchCase(from, to)) =>
-            keyword(caseSpaces + "case ").l ++ inner(from, skipThisTypePrefix) ++ keyword(" => ").l ++ inner(to, skipThisTypePrefix)(using indent = indent + 2) ++ plain("\n").l
+               keyword(caseSpaces + "case ").l
+            ++ inner(from, skipThisTypePrefix)
+            ++ keyword(" => ").l
+            ++ inner(to, skipThisTypePrefix)(using indent = indent + 2, skipTypeSuffix = skipTypeSuffix)
+            ++ plain("\n").l
         }
         inner(sc, skipThisTypePrefix) ++ keyword(" match ").l ++ plain("{\n").l ++ casesTexts ++ plain(spaces + "}").l
 
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/19414-desugared.check b/tests/neg/i19414-desugared.check
similarity index 91%
rename from tests/neg/19414-desugared.check
rename to tests/neg/i19414-desugared.check
index cc51ee471553..72a3a5eabd37 100644
--- a/tests/neg/19414-desugared.check
+++ b/tests/neg/i19414-desugared.check
@@ -1,4 +1,4 @@
--- [E172] Type Error: tests/neg/19414-desugared.scala:22:34 ------------------------------------------------------------
+-- [E172] Type Error: tests/neg/i19414-desugared.scala:22:34 -----------------------------------------------------------
 22 |  summon[BodySerializer[JsObject]] // error: Ambiguous given instances
    |                                  ^
    |No best given instance of type BodySerializer[JsObject] was found for parameter x of method summon in object Predef.
diff --git a/tests/neg/19414-desugared.scala b/tests/neg/i19414-desugared.scala
similarity index 100%
rename from tests/neg/19414-desugared.scala
rename to tests/neg/i19414-desugared.scala
diff --git a/tests/neg/19414.check b/tests/neg/i19414.check
similarity index 91%
rename from tests/neg/19414.check
rename to tests/neg/i19414.check
index 016e3942c825..10bc939494c6 100644
--- a/tests/neg/19414.check
+++ b/tests/neg/i19414.check
@@ -1,4 +1,4 @@
--- [E172] Type Error: tests/neg/19414.scala:15:34 ----------------------------------------------------------------------
+-- [E172] Type Error: tests/neg/i19414.scala:15:34 ---------------------------------------------------------------------
 15 |  summon[BodySerializer[JsObject]] // error: Ambiguous given instances
    |                                  ^
    |No best given instance of type BodySerializer[JsObject] was found for parameter x of method summon in object Predef.
diff --git a/tests/neg/19414.scala b/tests/neg/i19414.scala
similarity index 100%
rename from tests/neg/19414.scala
rename to tests/neg/i19414.scala
diff --git a/tests/neg/i23155a.scala b/tests/neg/i23155a.scala
new file mode 100644
index 000000000000..ac48bbf298e0
--- /dev/null
+++ b/tests/neg/i23155a.scala
@@ -0,0 +1,7 @@
+import scala.NamedTuple
+object Unpack_NT {
+  (1, 2) match {
+    case Unpack_NT(first, _) => first // error
+  }
+  def unapply(e: (Int, Int)): Some[NamedTuple.NamedTuple["x" *: "y" *: EmptyTuple, Int *: Int *: EmptyTuple]] = ???
+}
diff --git a/tests/neg/i23155b.scala b/tests/neg/i23155b.scala
new file mode 100644
index 000000000000..ef35f4631983
--- /dev/null
+++ b/tests/neg/i23155b.scala
@@ -0,0 +1,6 @@
+object Unpack_T {
+  (1, 2) match {
+    case Unpack_T(first, _) => first // error
+  }
+  def unapply(e: (Int, Int)): Some[Int *: Int *: EmptyTuple] = ???
+}
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/neg/nowarn.check b/tests/neg/nowarn.check
deleted file mode 100644
index ff01de1788bd..000000000000
--- a/tests/neg/nowarn.check
+++ /dev/null
@@ -1,110 +0,0 @@
--- [E002] Syntax Warning: tests/neg/nowarn.scala:11:10 -----------------------------------------------------------------
-11 |def t1a = try 1 // warning (parser)
-   |          ^^^^^
-   |          A try without catch or finally is equivalent to putting
-   |          its body in a block; no exceptions are handled.
-   |
-   | longer explanation available when compiling with `-explain`
--- [E002] Syntax Warning: tests/neg/nowarn.scala:25:25 -----------------------------------------------------------------
-25 |@nowarn(o.inl) def t2d = try 1   // two warnings (`inl` is not a compile-time constant)
-   |                         ^^^^^
-   |                         A try without catch or finally is equivalent to putting
-   |                         its body in a block; no exceptions are handled.
-   |
-   | longer explanation available when compiling with `-explain`
--- [E002] Syntax Warning: tests/neg/nowarn.scala:33:26 -----------------------------------------------------------------
-33 |@nowarn("id=1") def t4d = try 1 // error and warning (unused nowarn, wrong id)
-   |                          ^^^^^
-   |                          A try without catch or finally is equivalent to putting
-   |                          its body in a block; no exceptions are handled.
-   |
-   | longer explanation available when compiling with `-explain`
--- [E002] Syntax Warning: tests/neg/nowarn.scala:35:28 -----------------------------------------------------------------
-35 |@nowarn("verbose") def t5 = try 1 // warning with details
-   |                            ^^^^^
-   |                            A try without catch or finally is equivalent to putting
-   |                            its body in a block; no exceptions are handled.
-   |Matching filters for @nowarn or -Wconf:
-   |  - id=E2
-   |  - name=EmptyCatchAndFinallyBlock
-   |
-   | longer explanation available when compiling with `-explain`
--- [E129] Potential Issue Warning: tests/neg/nowarn.scala:15:11 --------------------------------------------------------
-15 |def t2 = { 1; 2 } // warning (the invalid nowarn doesn't silence anything)
-   |           ^
-   |           A pure expression does nothing in statement position
-   |
-   | longer explanation available when compiling with `-explain`
--- Warning: tests/neg/nowarn.scala:14:8 --------------------------------------------------------------------------------
-14 |@nowarn("wat?") // warning (typer, invalid filter)
-   |        ^^^^^^
-   |        Invalid message filter
-   |        unknown filter: wat?
--- [E129] Potential Issue Warning: tests/neg/nowarn.scala:18:12 --------------------------------------------------------
-18 |def t2a = { 1; 2 } // warning (invalid nowarn doesn't silence)
-   |            ^
-   |            A pure expression does nothing in statement position
-   |
-   | longer explanation available when compiling with `-explain`
--- Warning: tests/neg/nowarn.scala:17:8 --------------------------------------------------------------------------------
-17 |@nowarn(t1a.toString) // warning (typer, argument not a compile-time constant)
-   |        ^^^^^^^^^^^^
-   |        filter needs to be a compile-time constant string
--- Warning: tests/neg/nowarn.scala:25:10 -------------------------------------------------------------------------------
-25 |@nowarn(o.inl) def t2d = try 1   // two warnings (`inl` is not a compile-time constant)
-   |        ^^^^^
-   |        filter needs to be a compile-time constant string
--- Deprecation Warning: tests/neg/nowarn.scala:39:10 -------------------------------------------------------------------
-39 |def t6a = f // warning (refchecks, deprecation)
-   |          ^
-   |          method f is deprecated
--- Deprecation Warning: tests/neg/nowarn.scala:42:30 -------------------------------------------------------------------
-42 |@nowarn("msg=fish") def t6d = f // error (unused nowarn), warning (deprecation)
-   |                              ^
-   |                              method f is deprecated
--- Deprecation Warning: tests/neg/nowarn.scala:49:10 -------------------------------------------------------------------
-49 |def t7c = f             // warning (deprecation)
-   |          ^
-   |          method f is deprecated
--- [E092] Pattern Match Unchecked Warning: tests/neg/nowarn.scala:55:7 -------------------------------------------------
-55 |  case _: List[Int] => 0 // warning (patmat, unchecked)
-   |       ^
-   |the type test for List[Int] cannot be checked at runtime because its type arguments can't be determined from Any
-   |
-   | longer explanation available when compiling with `-explain`
--- Error: tests/neg/nowarn.scala:33:1 ----------------------------------------------------------------------------------
-33 |@nowarn("id=1") def t4d = try 1 // error and warning (unused nowarn, wrong id)
-   |^^^^^^^^^^^^^^^
-   |@nowarn annotation does not suppress any warnings
--- Error: tests/neg/nowarn.scala:42:1 ----------------------------------------------------------------------------------
-42 |@nowarn("msg=fish") def t6d = f // error (unused nowarn), warning (deprecation)
-   |^^^^^^^^^^^^^^^^^^^
-   |@nowarn annotation does not suppress any warnings
--- Error: tests/neg/nowarn.scala:50:5 ----------------------------------------------------------------------------------
-50 |  : @nowarn("msg=fish") // error (unused nowarn)
-   |    ^^^^^^^^^^^^^^^^^^^
-   |    @nowarn annotation does not suppress any warnings
--- Error: tests/neg/nowarn.scala:62:0 ----------------------------------------------------------------------------------
-62 |@nowarn def t9a = { 1: @nowarn; 2 } // error (outer @nowarn is unused)
-   |^^^^^^^
-   |@nowarn annotation does not suppress any warnings
--- Error: tests/neg/nowarn.scala:63:27 ---------------------------------------------------------------------------------
-63 |@nowarn def t9b = { 1: Int @nowarn; 2 } // error (inner @nowarn is unused, it covers the type, not the expression)
-   |                           ^^^^^^^
-   |                           @nowarn annotation does not suppress any warnings
--- Error: tests/neg/nowarn.scala:68:0 ----------------------------------------------------------------------------------
-68 |@nowarn @ann(f) def t10b = 0  // error (unused nowarn)
-   |^^^^^^^
-   |@nowarn annotation does not suppress any warnings
--- Error: tests/neg/nowarn.scala:69:8 ----------------------------------------------------------------------------------
-69 |@ann(f: @nowarn) def t10c = 0 // error (unused nowarn), should be silent
-   |        ^^^^^^^
-   |        @nowarn annotation does not suppress any warnings
--- Error: tests/neg/nowarn.scala:72:0 ----------------------------------------------------------------------------------
-72 |@nowarn class I1a { // error (unused nowarn)
-   |^^^^^^^
-   |@nowarn annotation does not suppress any warnings
--- Error: tests/neg/nowarn.scala:77:0 ----------------------------------------------------------------------------------
-77 |@nowarn class I1b { // error (unused nowarn)
-   |^^^^^^^
-   |@nowarn annotation does not suppress any warnings
diff --git a/tests/neg/nowarn.scala b/tests/neg/nowarn.scala
deleted file mode 100644
index 5b18ab5ccc51..000000000000
--- a/tests/neg/nowarn.scala
+++ /dev/null
@@ -1,89 +0,0 @@
-//> using options -deprecation -Wunused:nowarn "-Wconf:msg=@nowarn annotation does not suppress any warnings:e"
-
-import scala.annotation.{ nowarn, Annotation }
-
-// This test doesn't run with `-Werror`, because once there's an error, later phases are skipped and we would not see
-// their warnings.
-// Instead, this test runs with `-Wunused:nowarn -Wconf:msg=@nowarn annotation does not suppress any warnings:e`.
-// Only "unused nowarn" warnings are reported as errors. Since these warnings are reported at the very end, all other
-// phases of the compiler run normally.
-
-def t1a = try 1 // warning (parser)
-@nowarn("msg=try without catch") def t1b = try 1
-
-@nowarn("wat?") // warning (typer, invalid filter)
-def t2 = { 1; 2 } // warning (the invalid nowarn doesn't silence anything)
-
-@nowarn(t1a.toString) // warning (typer, argument not a compile-time constant)
-def t2a = { 1; 2 } // warning (invalid nowarn doesn't silence)
-
-object o:
-  final val const = "msg=try"
-  inline def inl = "msg=try"
-
-@nowarn(o.const) def t2c = try 1 // no warning
-@nowarn(o.inl) def t2d = try 1   // two warnings (`inl` is not a compile-time constant)
-
-@nowarn("id=E129") def t3a = { 1; 2 }
-@nowarn("name=PureExpressionInStatementPosition") def t3b = { 1; 2 }
-
-@nowarn("id=E002") def t4a = try 1
-@nowarn("id=E2") def t4b = try 1
-@nowarn("id=2") def t4c = try 1
-@nowarn("id=1") def t4d = try 1 // error and warning (unused nowarn, wrong id)
-
-@nowarn("verbose") def t5 = try 1 // warning with details
-
-@deprecated def f = 0
-
-def t6a = f // warning (refchecks, deprecation)
-@nowarn("cat=deprecation") def t6b = f
-@nowarn("msg=deprecated") def t6c = f
-@nowarn("msg=fish") def t6d = f // error (unused nowarn), warning (deprecation)
-@nowarn("") def t6e = f
-@nowarn def t6f = f
-
-def t7a = f: @nowarn("cat=deprecation")
-def t7b = f
-  : @nowarn("msg=deprecated")
-def t7c = f             // warning (deprecation)
-  : @nowarn("msg=fish") // error (unused nowarn)
-def t7d = f: @nowarn("")
-def t7e = f: @nowarn
-
-def t8a(x: Any) = x match
-  case _: List[Int] => 0 // warning (patmat, unchecked)
-  case _ => 1
-
-@nowarn("cat=unchecked") def t8(x: Any) = x match
-  case _: List[Int] => 0
-  case _ => 1
-
-@nowarn def t9a = { 1: @nowarn; 2 } // error (outer @nowarn is unused)
-@nowarn def t9b = { 1: Int @nowarn; 2 } // error (inner @nowarn is unused, it covers the type, not the expression)
-
-class ann(a: Any) extends Annotation
-
-@ann(f) def t10a = 0          // should be a deprecation warning, but currently isn't
-@nowarn @ann(f) def t10b = 0  // error (unused nowarn)
-@ann(f: @nowarn) def t10c = 0 // error (unused nowarn), should be silent
-
-def forceCompletionOfI1a = (new I1a).m
-@nowarn class I1a { // error (unused nowarn)
-  @nowarn def m = { 1; 2 }
-}
-
-// completion during type checking
-@nowarn class I1b { // error (unused nowarn)
-  @nowarn def m = { 1; 2 }
-}
-
-@nowarn class I1c {
-  def m = { 1; 2 }
-}
-
-trait T {
-  @nowarn val t1 = { 0; 1 }
-}
-
-class K extends T
diff --git a/tests/pos-custom-args/captures/tuple-ops.scala b/tests/pos-custom-args/captures/tuple-ops.scala
new file mode 100644
index 000000000000..6259328dd9ab
--- /dev/null
+++ b/tests/pos-custom-args/captures/tuple-ops.scala
@@ -0,0 +1,13 @@
+sealed trait Tupp
+
+case object EmptyTupp extends Tupp
+type EmptyTupp = EmptyTupp.type
+infix case class `*::`[H, T <: Tupp](h: H, t: T) extends Tupp
+
+type Union[T <: Tupp] = T match
+  case EmptyTupp => Nothing
+  case h *:: t   => h | Union[t]
+
+type Map[T <: Tupp, F[_ <: Union[T]]] <: Tupp = T match
+  case EmptyTupp => EmptyTupp
+  case h *:: t   => F[h] *:: Map[t, F]
\ No newline at end of file
diff --git a/tests/pos/i23611.scala b/tests/pos/i23611.scala
new file mode 100644
index 000000000000..0fef178b9c32
--- /dev/null
+++ b/tests/pos/i23611.scala
@@ -0,0 +1,26 @@
+import java.io.{File, IOException}
+import java.net.URI
+import java.nio.file.{Path, Paths}
+import scala.reflect.ClassTag
+
+trait FileConnectors {
+  def listPath(path: => Path): ZStream[Any, IOException, Path]
+
+  final def listFile(file: => File): ZStream[Any, IOException, File] =
+    for {
+      path <- null.asInstanceOf[ZStream[Any, IOException, Path]]
+      r    <- listPath(path).mapZIO(a => ZIO.attempt(a.toFile).refineToOrDie)
+    } yield r
+}
+
+sealed trait ZIO[-R, +E, +A]
+extension [R, E <: Throwable, A](self: ZIO[R, E, A])
+  def refineToOrDie[E1 <: E: ClassTag]: ZIO[R, E1, A] = ???
+
+object ZIO:
+  def attempt[A](code: => A): ZIO[Any, Throwable, A] = ???
+
+sealed trait ZStream[-R, +E, +A]:
+  def map[B](f: A => B): ZStream[R, E, B] = ???
+  def flatMap[R1 <: R, E1 >: E, B](f: A => ZStream[R1, E1, B]): ZStream[R1, E1, B]
+  def mapZIO[R1 <: R, E1 >: E, A1](f: A => ZIO[R1, E1, A1]): ZStream[R1, E1, A1]
\ No newline at end of file
diff --git a/tests/pos/i23611a.scala b/tests/pos/i23611a.scala
new file mode 100644
index 000000000000..fbaf709e2f0e
--- /dev/null
+++ b/tests/pos/i23611a.scala
@@ -0,0 +1,30 @@
+import java.io.{File, IOException}
+import java.net.URI
+import java.nio.file.{Path, Paths}
+import scala.reflect.ClassTag
+
+trait FileConnectors {
+  def listPath(path: => Path): ZStream[Any, IOException, Path]
+
+  final def listFile(file: => File): ZStream[Any, IOException, File] =
+    for {
+      path <- null.asInstanceOf[ZStream[Any, IOException, Path]]
+      r    <- listPath(path).mapZIO(a => ZIO.attempt(a.toFile).refineToOrDie)
+    } yield r
+}
+
+sealed abstract class CanFail[-E]
+object CanFail:
+  given [E]: CanFail[E] = ???
+
+sealed trait ZIO[-R, +E, +A]
+extension [R, E <: Throwable, A](self: ZIO[R, E, A])
+  def refineToOrDie[E1 <: E: ClassTag](using CanFail[E]): ZIO[R, E1, A] = ???
+
+object ZIO:
+  def attempt[A](code: => A): ZIO[Any, Throwable, A] = ???
+
+sealed trait ZStream[-R, +E, +A]:
+  def map[B](f: A => B): ZStream[R, E, B] = ???
+  def flatMap[R1 <: R, E1 >: E, B](f: A => ZStream[R1, E1, B]): ZStream[R1, E1, B]
+  def mapZIO[R1 <: R, E1 >: E, A1](f: A => ZIO[R1, E1, A1]): ZStream[R1, E1, A1]
\ No newline at end of file
diff --git a/tests/pos/i23627.scala b/tests/pos/i23627.scala
new file mode 100644
index 000000000000..1480a80c9c00
--- /dev/null
+++ b/tests/pos/i23627.scala
@@ -0,0 +1,18 @@
+trait TestContainer:
+  trait TestPath[T]:
+    type AbsMember
+
+  extension (path: TestPath[?])
+    infix def ext(color: path.AbsMember): Unit = ???
+    infix def ext(other: Int): Unit = ???
+
+object Repro:
+  val dc2: TestContainer = ???
+  import dc2.TestPath
+
+  def transition(path: TestPath[?])(using DummyImplicit): TestPath[?] = ???
+
+  def test: Unit =
+    val di: TestPath[?] = ???
+    // error
+    val z1 = transition(di).ext(1)
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
diff --git a/tests/warn/i23541.check b/tests/warn/i23541.check
new file mode 100644
index 000000000000..64ffbd9808d2
--- /dev/null
+++ b/tests/warn/i23541.check
@@ -0,0 +1,18 @@
+-- [E220] Type Warning: tests/warn/i23541.scala:29:13 ------------------------------------------------------------------
+29 |    println(f(using s = "ab")) // warn uses default instead of given // prints "ab"
+   |            ^^^^^^^^^^^^^^^^^
+   |            Argument for implicit parameter i was supplied using a default argument.
+   |
+   | longer explanation available when compiling with `-explain`
+-- [E221] Type Warning: tests/warn/i23541.scala:5:17 -------------------------------------------------------------------
+5 |  else fun(x - 1)(using p = p + x) // warn recurse uses default (instead of given passed down the stack)
+  |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  |       Recursive call used a default argument for parameter q.
+  |
+  | longer explanation available when compiling with `-explain`
+-- [E221] Type Warning: tests/warn/i23541.scala:9:17 -------------------------------------------------------------------
+9 |  else gun(x - 1)(p = p + x) // warn recurse uses default (value not passed down the stack)
+  |       ^^^^^^^^^^^^^^^^^^^^^
+  |       Recursive call used a default argument for parameter q.
+  |
+  | longer explanation available when compiling with `-explain`
diff --git a/tests/warn/i23541.scala b/tests/warn/i23541.scala
new file mode 100644
index 000000000000..7f374b421ba3
--- /dev/null
+++ b/tests/warn/i23541.scala
@@ -0,0 +1,30 @@
+//> using options -Wrecurse-with-default
+
+def fun(x: Int)(using p: Int, q: Int = 0): Int =
+  if x <= 0 then p * q
+  else fun(x - 1)(using p = p + x) // warn recurse uses default (instead of given passed down the stack)
+
+def gun(x: Int)(p: Int, q: Int = 0): Int =
+  if x <= 0 then p * q
+  else gun(x - 1)(p = p + x) // warn recurse uses default (value not passed down the stack)
+
+def nested(using x: Int, y: Int = 42): Int =
+  def f: Int = nested(using x) // nowarn only self-recursive tailrec is eligible for warning
+  f
+
+def f(using s: String, i: Int = 1): String = s * i
+def g(using s: String)(using i: Int = 1): String = s * i
+
+@main def Test =
+  println(fun(3)(using p = 0, q = 1))
+  locally:
+    given String = "ab"
+    println(f) // prints "ab"
+    println(g) // prints "ab"
+  locally:
+    println(f(using s = "ab")) // prints "ab"
+    println(g(using s = "ab")) // prints "ab"
+  locally:
+    given Int = 2
+    println(f(using s = "ab")) // warn uses default instead of given // prints "ab"
+    println(g(using s = "ab")) // prints "abab"
diff --git a/tests/warn/i23651.scala b/tests/warn/i23651.scala
new file mode 100644
index 000000000000..c81ddb4249f8
--- /dev/null
+++ b/tests/warn/i23651.scala
@@ -0,0 +1,27 @@
+//> using options -deprecation -Wunused:nowarn
+
+import scala.annotation.nowarn
+
+@deprecated
+class A
+
+@deprecated
+class B
+
+@nowarn("msg=trait C is deprecated") // warn
+  // @nowarn annotation does not suppress any warnings
+@nowarn("msg=class A is deprecated")
+@nowarn("cat=deprecation&msg=class A is deprecated") // warn
+  // @nowarn annotation does not suppress any warnings but matches a diagnostic
+@nowarn("cat=deprecation&msg=class B is deprecated")
+trait C1:
+  def a: A
+  def b: B
+
+@nowarn("cat=deprecation&msg=class B is deprecated")
+@nowarn("cat=deprecation&msg=class B is deprecated") // warn
+  // @nowarn annotation does not suppress any warnings but matches a diagnostic
+@nowarn("cat=deprecation&msg=class A is deprecated")
+trait C2:
+  def a: A
+  def b: B
diff --git a/tests/warn/nowarn.check b/tests/warn/nowarn.check
new file mode 100644
index 000000000000..89ff8d51161b
--- /dev/null
+++ b/tests/warn/nowarn.check
@@ -0,0 +1,110 @@
+-- [E002] Syntax Warning: tests/warn/nowarn.scala:5:10 -----------------------------------------------------------------
+5 |def t1a = try 1 // warn (parser)
+  |          ^^^^^
+  |          A try without catch or finally is equivalent to putting
+  |          its body in a block; no exceptions are handled.
+  |
+  | longer explanation available when compiling with `-explain`
+-- [E002] Syntax Warning: tests/warn/nowarn.scala:19:25 ----------------------------------------------------------------
+19 |@nowarn(o.inl) def t2d = try 1   // warn // warn (`inl` is not a compile-time constant)
+   |                         ^^^^^
+   |                         A try without catch or finally is equivalent to putting
+   |                         its body in a block; no exceptions are handled.
+   |
+   | longer explanation available when compiling with `-explain`
+-- [E002] Syntax Warning: tests/warn/nowarn.scala:27:26 ----------------------------------------------------------------
+27 |@nowarn("id=1") def t4d = try 1 // warn // warn (unused nowarn, wrong id)
+   |                          ^^^^^
+   |                          A try without catch or finally is equivalent to putting
+   |                          its body in a block; no exceptions are handled.
+   |
+   | longer explanation available when compiling with `-explain`
+-- [E002] Syntax Warning: tests/warn/nowarn.scala:29:28 ----------------------------------------------------------------
+29 |@nowarn("verbose") def t5 = try 1 // warn with details
+   |                            ^^^^^
+   |                            A try without catch or finally is equivalent to putting
+   |                            its body in a block; no exceptions are handled.
+   |Matching filters for @nowarn or -Wconf:
+   |  - id=E2
+   |  - name=EmptyCatchAndFinallyBlock
+   |
+   | longer explanation available when compiling with `-explain`
+-- [E129] Potential Issue Warning: tests/warn/nowarn.scala:9:11 --------------------------------------------------------
+9 |def t2 = { 1; 2 } // warn (the invalid nowarn doesn't silence anything)
+  |           ^
+  |           A pure expression does nothing in statement position
+  |
+  | longer explanation available when compiling with `-explain`
+-- Warning: tests/warn/nowarn.scala:8:8 --------------------------------------------------------------------------------
+8 |@nowarn("wat?") // warn (typer, invalid filter)
+  |        ^^^^^^
+  |        Invalid message filter
+  |        unknown filter: wat?
+-- [E129] Potential Issue Warning: tests/warn/nowarn.scala:12:12 -------------------------------------------------------
+12 |def t2a = { 1; 2 } // warn (invalid nowarn doesn't silence)
+   |            ^
+   |            A pure expression does nothing in statement position
+   |
+   | longer explanation available when compiling with `-explain`
+-- Warning: tests/warn/nowarn.scala:11:8 -------------------------------------------------------------------------------
+11 |@nowarn(t1a.toString) // warn (typer, argument not a compile-time constant)
+   |        ^^^^^^^^^^^^
+   |        filter needs to be a compile-time constant string
+-- Warning: tests/warn/nowarn.scala:19:10 ------------------------------------------------------------------------------
+19 |@nowarn(o.inl) def t2d = try 1   // warn // warn (`inl` is not a compile-time constant)
+   |        ^^^^^
+   |        filter needs to be a compile-time constant string
+-- Deprecation Warning: tests/warn/nowarn.scala:33:10 ------------------------------------------------------------------
+33 |def t6a = f // warn (refchecks, deprecation)
+   |          ^
+   |          method f is deprecated
+-- Deprecation Warning: tests/warn/nowarn.scala:36:30 ------------------------------------------------------------------
+36 |@nowarn("msg=fish") def t6d = f // warn (unused nowarn) // warn (deprecation)
+   |                              ^
+   |                              method f is deprecated
+-- Deprecation Warning: tests/warn/nowarn.scala:43:10 ------------------------------------------------------------------
+43 |def t7c = f             // warn (deprecation)
+   |          ^
+   |          method f is deprecated
+-- [E092] Pattern Match Unchecked Warning: tests/warn/nowarn.scala:49:7 ------------------------------------------------
+49 |  case _: List[Int] => 0 // warn (patmat, unchecked)
+   |       ^
+   |the type test for List[Int] cannot be checked at runtime because its type arguments can't be determined from Any
+   |
+   | longer explanation available when compiling with `-explain`
+-- Warning: tests/warn/nowarn.scala:27:1 -------------------------------------------------------------------------------
+27 |@nowarn("id=1") def t4d = try 1 // warn // warn (unused nowarn, wrong id)
+   |^^^^^^^^^^^^^^^
+   |@nowarn annotation does not suppress any warnings
+-- Warning: tests/warn/nowarn.scala:36:1 -------------------------------------------------------------------------------
+36 |@nowarn("msg=fish") def t6d = f // warn (unused nowarn) // warn (deprecation)
+   |^^^^^^^^^^^^^^^^^^^
+   |@nowarn annotation does not suppress any warnings
+-- Warning: tests/warn/nowarn.scala:44:5 -------------------------------------------------------------------------------
+44 |  : @nowarn("msg=fish") // warn (unused nowarn)
+   |    ^^^^^^^^^^^^^^^^^^^
+   |    @nowarn annotation does not suppress any warnings
+-- Warning: tests/warn/nowarn.scala:56:0 -------------------------------------------------------------------------------
+56 |@nowarn def t9a = { 1: @nowarn; 2 } // warn (outer @nowarn is unused)
+   |^^^^^^^
+   |@nowarn annotation does not suppress any warnings but matches a diagnostic
+-- Warning: tests/warn/nowarn.scala:57:27 ------------------------------------------------------------------------------
+57 |@nowarn def t9b = { 1: Int @nowarn; 2 } // warn (inner @nowarn is unused, it covers the type, not the expression)
+   |                           ^^^^^^^
+   |                           @nowarn annotation does not suppress any warnings
+-- Warning: tests/warn/nowarn.scala:62:0 -------------------------------------------------------------------------------
+62 |@nowarn @ann(f) def t10b = 0  // warn (unused nowarn)
+   |^^^^^^^
+   |@nowarn annotation does not suppress any warnings
+-- Warning: tests/warn/nowarn.scala:63:8 -------------------------------------------------------------------------------
+63 |@ann(f: @nowarn) def t10c = 0 // warn (unused nowarn), should be silent
+   |        ^^^^^^^
+   |        @nowarn annotation does not suppress any warnings
+-- Warning: tests/warn/nowarn.scala:66:0 -------------------------------------------------------------------------------
+66 |@nowarn class I1a { // warn (unused nowarn)
+   |^^^^^^^
+   |@nowarn annotation does not suppress any warnings but matches a diagnostic
+-- Warning: tests/warn/nowarn.scala:71:0 -------------------------------------------------------------------------------
+71 |@nowarn class I1b { // warn (unused nowarn)
+   |^^^^^^^
+   |@nowarn annotation does not suppress any warnings but matches a diagnostic
diff --git a/tests/warn/nowarn.scala b/tests/warn/nowarn.scala
new file mode 100644
index 000000000000..f6cacdd677d0
--- /dev/null
+++ b/tests/warn/nowarn.scala
@@ -0,0 +1,83 @@
+//> using options -deprecation -Wunused:nowarn
+
+import scala.annotation.{nowarn, Annotation}
+
+def t1a = try 1 // warn (parser)
+@nowarn("msg=try without catch") def t1b = try 1
+
+@nowarn("wat?") // warn (typer, invalid filter)
+def t2 = { 1; 2 } // warn (the invalid nowarn doesn't silence anything)
+
+@nowarn(t1a.toString) // warn (typer, argument not a compile-time constant)
+def t2a = { 1; 2 } // warn (invalid nowarn doesn't silence)
+
+object o:
+  final val const = "msg=try"
+  inline def inl = "msg=try"
+
+@nowarn(o.const) def t2c = try 1 // no warn
+@nowarn(o.inl) def t2d = try 1   // warn // warn (`inl` is not a compile-time constant)
+
+@nowarn("id=E129") def t3a = { 1; 2 }
+@nowarn("name=PureExpressionInStatementPosition") def t3b = { 1; 2 }
+
+@nowarn("id=E002") def t4a = try 1
+@nowarn("id=E2") def t4b = try 1
+@nowarn("id=2") def t4c = try 1
+@nowarn("id=1") def t4d = try 1 // warn // warn (unused nowarn, wrong id)
+
+@nowarn("verbose") def t5 = try 1 // warn with details
+
+@deprecated def f = 0
+
+def t6a = f // warn (refchecks, deprecation)
+@nowarn("cat=deprecation") def t6b = f
+@nowarn("msg=deprecated") def t6c = f
+@nowarn("msg=fish") def t6d = f // warn (unused nowarn) // warn (deprecation)
+@nowarn("") def t6e = f
+@nowarn def t6f = f
+
+def t7a = f: @nowarn("cat=deprecation")
+def t7b = f
+  : @nowarn("msg=deprecated")
+def t7c = f             // warn (deprecation)
+  : @nowarn("msg=fish") // warn (unused nowarn)
+def t7d = f: @nowarn("")
+def t7e = f: @nowarn
+
+def t8a(x: Any) = x match
+  case _: List[Int] => 0 // warn (patmat, unchecked)
+  case _ => 1
+
+@nowarn("cat=unchecked") def t8(x: Any) = x match
+  case _: List[Int] => 0
+  case _ => 1
+
+@nowarn def t9a = { 1: @nowarn; 2 } // warn (outer @nowarn is unused)
+@nowarn def t9b = { 1: Int @nowarn; 2 } // warn (inner @nowarn is unused, it covers the type, not the expression)
+
+class ann(a: Any) extends Annotation
+
+@ann(f) def t10a = 0          // should be a deprecation warning, but currently isn't
+@nowarn @ann(f) def t10b = 0  // warn (unused nowarn)
+@ann(f: @nowarn) def t10c = 0 // warn (unused nowarn), should be silent
+
+def forceCompletionOfI1a = (new I1a).m
+@nowarn class I1a { // warn (unused nowarn)
+  @nowarn def m = { 1; 2 }
+}
+
+// completion during type checking
+@nowarn class I1b { // warn (unused nowarn)
+  @nowarn def m = { 1; 2 }
+}
+
+@nowarn class I1c {
+  def m = { 1; 2 }
+}
+
+trait T {
+  @nowarn val t1 = { 0; 1 }
+}
+
+class K extends T
