From 5a942eb7e3428c32c4a279fa215726772b0346a8 Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Sun, 23 Jun 2024 01:33:14 +0200 Subject: [PATCH] Supress false-positive match exhastivity warning --- compiler/src/dotty/tools/dotc/typer/Typer.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index 864a52c8c538..a74f6dc32668 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -1104,13 +1104,14 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer // transform the `Ident` into a `Select` to ensure that the prefix // is retained with a `TypedSplice` (see `case Select` bellow). // See tests/pos/i18713.scala for an example. - fn.tpe match + (fn.tpe match case TermRef(qual: TermRef, _) => toSetter(ref(qual).select(fn.symbol).withSpan(fn.span)) case TermRef(qual: ThisType, _) => toSetter(This(qual.cls).select(fn.symbol).withSpan(fn.span)) case TermRef(NoPrefix, _) => untpd.cpy.Ident(fn)(name.setterName) + ): @annotation.nowarn // false-positive match exhastivity warning case fn @ Select(qual, name: TermName) => untpd.cpy.Select(fn)(untpd.TypedSplice(qual), name.setterName) case fn @ TypeApply(fn1, targs) =>