Skip to content

Commit 4bb8020

Browse files
committed
merge and resolve conflict
2 parents 5946ef8 + a20027f commit 4bb8020

33 files changed

+307
-45
lines changed

.github/workflows/lts-backport.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
with:
1616
fetch-depth: 0
1717
- uses: coursier/cache-action@v6
18-
- uses: VirtusLab/[email protected].1
18+
- uses: VirtusLab/[email protected].2
1919
- run: scala-cli ./project/scripts/addToBackportingProject.scala -- ${{ github.sha }}
2020
env:
2121
GRAPHQL_API_TOKEN: ${{ secrets.GRAPHQL_API_TOKEN }}

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ class Definitions {
993993

994994
// Annotation base classes
995995
@tu lazy val AnnotationClass: ClassSymbol = requiredClass("scala.annotation.Annotation")
996-
@tu lazy val StaticAnnotationClass: ClassSymbol = requiredClass("scala.annotation.StaticAnnotation")
996+
// @tu lazy val StaticAnnotationClass: ClassSymbol = requiredClass("scala.annotation.StaticAnnotation")
997997
@tu lazy val RefiningAnnotationClass: ClassSymbol = requiredClass("scala.annotation.RefiningAnnotation")
998998
@tu lazy val JavaAnnotationClass: ClassSymbol = requiredClass("java.lang.annotation.Annotation")
999999

@@ -1015,7 +1015,6 @@ class Definitions {
10151015
@tu lazy val ImplicitNotFoundAnnot: ClassSymbol = requiredClass("scala.annotation.implicitNotFound")
10161016
@tu lazy val InlineParamAnnot: ClassSymbol = requiredClass("scala.annotation.internal.InlineParam")
10171017
@tu lazy val ErasedParamAnnot: ClassSymbol = requiredClass("scala.annotation.internal.ErasedParam")
1018-
@tu lazy val InvariantBetweenAnnot: ClassSymbol = requiredClass("scala.annotation.internal.InvariantBetween")
10191018
@tu lazy val MainAnnot: ClassSymbol = requiredClass("scala.main")
10201019
@tu lazy val MappedAlternativeAnnot: ClassSymbol = requiredClass("scala.annotation.internal.MappedAlternative")
10211020
@tu lazy val MigrationAnnot: ClassSymbol = requiredClass("scala.annotation.migration")
@@ -1027,7 +1026,7 @@ class Definitions {
10271026
@tu lazy val SourceFileAnnot: ClassSymbol = requiredClass("scala.annotation.internal.SourceFile")
10281027
@tu lazy val ScalaSignatureAnnot: ClassSymbol = requiredClass("scala.reflect.ScalaSignature")
10291028
@tu lazy val ScalaLongSignatureAnnot: ClassSymbol = requiredClass("scala.reflect.ScalaLongSignature")
1030-
@tu lazy val ScalaStrictFPAnnot: ClassSymbol = requiredClass("scala.annotation.strictfp")
1029+
// @tu lazy val ScalaStrictFPAnnot: ClassSymbol = requiredClass("scala.annotation.strictfp")
10311030
@tu lazy val ScalaStaticAnnot: ClassSymbol = requiredClass("scala.annotation.static")
10321031
@tu lazy val SerialVersionUIDAnnot: ClassSymbol = requiredClass("scala.SerialVersionUID")
10331032
@tu lazy val TailrecAnnot: ClassSymbol = requiredClass("scala.annotation.tailrec")
@@ -1055,7 +1054,6 @@ class Definitions {
10551054
@tu lazy val FunctionalInterfaceAnnot: ClassSymbol = requiredClass("java.lang.FunctionalInterface")
10561055
@tu lazy val TargetNameAnnot: ClassSymbol = requiredClass("scala.annotation.targetName")
10571056
@tu lazy val VarargsAnnot: ClassSymbol = requiredClass("scala.annotation.varargs")
1058-
@tu lazy val SinceAnnot: ClassSymbol = requiredClass("scala.annotation.since")
10591057
@tu lazy val ReachCapabilityAnnot = requiredClass("scala.annotation.internal.reachCapability")
10601058
@tu lazy val RequiresCapabilityAnnot: ClassSymbol = requiredClass("scala.annotation.internal.requiresCapability")
10611059
@tu lazy val RetainsAnnot: ClassSymbol = requiredClass("scala.annotation.retains")

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3436,7 +3436,8 @@ class TrackingTypeComparer(initctx: Context) extends TypeComparer(initctx) {
34363436
case MatchTypeCasePattern.BaseTypeTest(classType, argPatterns, needsConcreteScrut) =>
34373437
val cls = classType.classSymbol.asClass
34383438
scrut.baseType(cls) match
3439-
case base @ AppliedType(baseTycon, baseArgs) if baseTycon =:= classType =>
3439+
case base @ AppliedType(baseTycon, baseArgs) =>
3440+
// #19445 Don't check the prefix of baseTycon here; it is handled by `scrut <:< instantiatedPat`.
34403441
val innerScrutIsWidenedAbstract =
34413442
scrutIsWidenedAbstract
34423443
|| (needsConcreteScrut && !isConcrete(scrut)) // no point in checking concreteness if it does not need to be concrete

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ object Types extends TypeUtils {
197197
*/
198198
def isRef(sym: Symbol, skipRefined: Boolean = true)(using Context): Boolean = this match {
199199
case this1: TypeRef =>
200-
this1.info match { // see comment in Namer#typeDefSig
200+
this1.info match { // see comment in Namer#TypeDefCompleter#typeSig
201201
case TypeAlias(tp) => tp.isRef(sym, skipRefined)
202202
case _ => this1.symbol eq sym
203203
}

compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
309309
toText(tp.argType) ~ " ?=>? " ~ toText(tp.resultType)
310310
case tp @ FunProto(args, resultType) =>
311311
"[applied to ("
312-
~ keywordText("using ").provided(tp.isContextualMethod)
312+
~ keywordText("using ").provided(tp.applyKind == ApplyKind.Using)
313313
~ argsTreeText(args)
314314
~ ") returning "
315315
~ toText(resultType)

compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -657,17 +657,15 @@ object SpaceEngine {
657657
}
658658

659659
extension (tp: Type)
660-
/** A type is decomposable to children if it has a simple kind, it's sealed,
661-
* abstract (or a trait) - so its not a sealed concrete class that can be instantiated on its own,
662-
* has no anonymous children, which we wouldn't be able to name as counter-examples,
663-
* but does have children.
664-
*
665-
* A sealed trait with no subclasses is considered not decomposable and thus is treated as an opaque type.
666-
* A sealed trait with subclasses that then get removed after `refineUsingParent`, decomposes to the empty list.
667-
* So that's why we consider whether a type has children. */
668660
def isDecomposableToChildren(using Context): Boolean =
669-
val cls = tp.classSymbol
670-
tp.hasSimpleKind && cls.is(Sealed) && cls.isOneOf(AbstractOrTrait) && !cls.hasAnonymousChild && cls.children.nonEmpty
661+
val sym = tp.typeSymbol // e.g. Foo[List[Int]] = type Foo (i19275)
662+
val cls = tp.classSymbol // e.g. Foo[List[Int]] = class List
663+
tp.hasSimpleKind // can't decompose higher-kinded types
664+
&& cls.is(Sealed)
665+
&& cls.isOneOf(AbstractOrTrait) // ignore sealed non-abstract classes
666+
&& !cls.hasAnonymousChild // can't name anonymous classes as counter-examples
667+
&& cls.children.nonEmpty // can't decompose without children
668+
&& !sym.isOpaqueAlias // can't instantiate subclasses to conform to an opaque type (i19275)
671669

672670
val ListOfNoType = List(NoType)
673671
val ListOfTypNoType = ListOfNoType.map(Typ(_, decomposed = true))

compiler/src/dotty/tools/dotc/typer/Migrations.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,14 @@ trait Migrations:
106106
&& isContextBoundParams
107107
&& pt.applyKind != ApplyKind.Using
108108
then
109-
def rewriteMsg = Message.rewriteNotice("This code", mversion.patchFrom)
109+
def rewriteMsg =
110+
if pt.args.isEmpty then ""
111+
else Message.rewriteNotice("This code", mversion.patchFrom)
110112
report.errorOrMigrationWarning(
111113
em"""Context bounds will map to context parameters.
112114
|A `using` clause is needed to pass explicit arguments to them.$rewriteMsg""",
113115
tree.srcPos, mversion)
114-
if mversion.needsPatch then
116+
if mversion.needsPatch && pt.args.nonEmpty then
115117
patch(Span(pt.args.head.span.start), "using ")
116118
end contextBoundParams
117119

compiler/src/dotty/tools/dotc/typer/Namer.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,13 @@ class Namer { typer: Typer =>
12541254
newSymbol(cls, forwarderName, mbrFlags, mbrInfo, coord = span)
12551255

12561256
forwarder.info = avoidPrivateLeaks(forwarder)
1257-
forwarder.addAnnotations(sym.annotations.filterConserve(_.symbol != defn.BodyAnnot))
1257+
forwarder.addAnnotations(sym.annotations.filterConserve { annot =>
1258+
annot.symbol != defn.BodyAnnot
1259+
&& annot.symbol != defn.TailrecAnnot
1260+
&& annot.symbol != defn.MainAnnot
1261+
&& !annot.symbol.derivesFrom(defn.MacroAnnotationClass)
1262+
&& !annot.symbol.derivesFrom(defn.MainAnnotationClass)
1263+
})
12581264

12591265
if forwarder.isType then
12601266
buf += tpd.TypeDef(forwarder.asType).withSpan(span)

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
944944
* (x: T) to (x @ (w: T)). This is either `_` or `_*`.
945945
*/
946946
def cases(ifPat: => Tree, ifExpr: => Tree, wildName: TermName) = tree.expr match {
947-
case id: untpd.Ident if (ctx.mode is Mode.Pattern) && untpd.isVarPattern(id) =>
947+
case id: untpd.Ident if (ctx.mode is Mode.Pattern) =>
948948
if (id.name == nme.WILDCARD || id.name == nme.WILDCARD_STAR) ifPat
949949
else {
950950
import untpd.*
@@ -3904,7 +3904,10 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
39043904
if (arg.tpe.isError) Nil else untpd.NamedArg(pname, untpd.TypedSplice(arg)) :: Nil
39053905
}
39063906
val app = cpy.Apply(tree)(untpd.TypedSplice(tree), namedArgs)
3907-
if (wtp.isContextualMethod) app.setApplyKind(ApplyKind.Using)
3907+
val needsUsing = wtp.isContextualMethod || wtp.match
3908+
case MethodType(ContextBoundParamName(_) :: _) => sourceVersion.isAtLeast(`3.4`)
3909+
case _ => false
3910+
if needsUsing then app.setApplyKind(ApplyKind.Using)
39083911
typr.println(i"try with default implicit args $app")
39093912
typed(app, pt, locked)
39103913
else issueErrors()

library/src/scala/quoted/Quotes.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,10 +1637,11 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
16371637
* val q: Quotes = summon[Quotes]
16381638
* import q.reflect._
16391639
* //}
1640-
* val intArgs = List(Literal(Constant(1)), Literal(Constant(2)))
1640+
* val intArgs = List(Literal(IntConstant(1)), Literal(IntConstant(2)))
16411641
* Typed(
1642-
* Repeated(intArgs, TypeTree.of[Int]),
1643-
* Inferred(defn.RepeatedParamClass.typeRef.appliedTo(TypeRepr.of[Int]))
1642+
* Repeated(intArgs, TypeTree.of[Int]),
1643+
* Inferred(defn.RepeatedParamClass.typeRef.appliedTo(TypeRepr.of[Int]))
1644+
* )
16441645
* //{
16451646
* }
16461647
* //}

library/src/scala/util/boundary.scala

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ import scala.annotation.implicitNotFound
1515
* be rewritten to jumps.
1616
*
1717
* Example usage:
18+
*
19+
* ```scala
20+
* import scala.util.boundary, boundary.break
1821
*
19-
* import scala.util.boundary, boundary.break
20-
*
21-
* def firstIndex[T](xs: List[T], elem: T): Int =
22-
* boundary:
23-
* for (x, i) <- xs.zipWithIndex do
24-
* if x == elem then break(i)
25-
* -1
22+
* def firstIndex[T](xs: List[T], elem: T): Int =
23+
* boundary:
24+
* for (x, i) <- xs.zipWithIndex do
25+
* if x == elem then break(i)
26+
* -1
27+
* ```
2628
*/
2729
object boundary:
2830

project/Build.scala

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ object Build {
101101
* set to 3.1.3. If it is going to be 3.1.0, it must be set to the latest
102102
* 3.0.x release.
103103
*/
104-
val previousDottyVersion = "3.4.0-RC1"
104+
val previousDottyVersion = "3.4.0-RC3"
105+
106+
/** Version against which we check binary compatibility. */
107+
val ltsDottyVersion = "3.3.0"
105108

106109
object CompatMode {
107110
final val BinaryCompatible = 0
@@ -2163,6 +2166,14 @@ object Build {
21632166
(Compile/doc/target).value
21642167
},
21652168
commonMiMaSettings,
2169+
mimaPreviousArtifacts += {
2170+
val thisProjectID = projectID.value
2171+
val crossedName = thisProjectID.crossVersion match {
2172+
case cv: Disabled => thisProjectID.name
2173+
case cv: Binary => s"${thisProjectID.name}_${cv.prefix}3${cv.suffix}"
2174+
}
2175+
(thisProjectID.organization % crossedName % ltsDottyVersion)
2176+
},
21662177
mimaBackwardIssueFilters := MiMaFilters.LibraryBackwards,
21672178
mimaForwardIssueFilters := MiMaFilters.LibraryForward,
21682179
)
@@ -2360,6 +2371,9 @@ object ScaladocConfigs {
23602371
.add(DocumentSyntheticTypes(true))
23612372
.add(SnippetCompiler(List(
23622373
s"${dottyLibRoot}/scala=compile",
2374+
s"$dottyLibRoot/src/scala/compiletime=compile",
2375+
s"$dottyLibRoot/src/scala/util=compile",
2376+
s"$dottyLibRoot/src/scala/util/control=compile",
23632377
"docs/_docs/reference/new-types=compile"
23642378
)))
23652379
.add(SiteRoot("docs"))
@@ -2376,7 +2390,9 @@ object ScaladocConfigs {
23762390
.add(SnippetCompiler(
23772391
List(
23782392
s"$dottyLibrarySrc/scala/quoted=compile",
2379-
s"$dottyLibrarySrc/scala/compiletime=compile"
2393+
s"$dottyLibrarySrc/scala/compiletime=compile",
2394+
s"$dottyLibrarySrc/scala/util=compile",
2395+
s"$dottyLibrarySrc/scala/util/control=compile"
23802396
)
23812397
))
23822398
.add(CommentSyntax(List(

project/MiMaFilters.scala

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,61 @@ object MiMaFilters {
55
val LibraryBackwards: Map[String, Seq[ProblemFilter]] = Map(
66
// In general we should never have backwards incompatible changes in the library.
77
// Only exceptional cases should be added here.
8-
Build.previousDottyVersion -> Seq(
9-
// This language feature was in 3.4.0-RC1 but will be removed in 3.4.0-RC2
10-
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#deprecated.ascriptionVarargsUnpacking"),
11-
ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$deprecated$ascriptionVarargsUnpacking$"),
12-
)
8+
9+
// Breaking changes since last reference version
10+
Build.previousDottyVersion -> Seq.empty,
11+
12+
// Breaking changes since last LTS
13+
Build.ltsDottyVersion -> Seq(
14+
// Quotes is assumed to only be implemented by the compiler and on the same version of the library.
15+
// It is exceptionally OK to break this compatibility. In these cases, there add new abstract methods that would
16+
// potentially not be implemented by others. If some other library decides to implement these,
17+
// they need to recompile and republish on each minor release.
18+
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule.ValOrDefDefMethods"),
19+
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule.ValOrDefDefTypeTest"),
20+
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#defnModule.FunctionClass"),
21+
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#defnModule.PolyFunctionClass"),
22+
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#FlagsModule.AbsOverride"),
23+
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#SymbolMethods.paramVariance"),
24+
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TypeLambdaMethods.paramVariances"),
25+
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TypeReprMethods.dealiasKeepOpaques"),
26+
),
1327
)
1428
val LibraryForward: Map[String, Seq[ProblemFilter]] = Map(
1529
// Additions that require a new minor version of the library
1630
Build.previousDottyVersion -> Seq(
17-
// This language feature is not in 3.4.0-RC1 but will be added in 3.4.0-RC2
18-
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.5-migration"),
19-
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.5"),
31+
),
32+
33+
// Additions since last LTS
34+
Build.ltsDottyVersion -> Seq(
35+
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule.ValOrDefDefMethods"),
36+
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule.ValOrDefDefTypeTest"),
37+
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#defnModule.FunctionClass"),
38+
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#defnModule.PolyFunctionClass"),
39+
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#FlagsModule.AbsOverride"),
40+
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#SymbolMethods.paramVariance"),
41+
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TypeLambdaMethods.paramVariances"),
42+
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TypeReprMethods.dealiasKeepOpaques"),
43+
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.runtime.Tuples.reverse"),
44+
ProblemFilters.exclude[MissingClassProblem]("scala.annotation.internal.AssignedNonLocally"),
45+
ProblemFilters.exclude[MissingClassProblem]("scala.annotation.internal.CaptureChecked"),
46+
ProblemFilters.exclude[MissingClassProblem]("scala.annotation.internal.reachCapability"),
47+
ProblemFilters.exclude[MissingClassProblem]("scala.annotation.unchecked.uncheckedCaptures"),
48+
ProblemFilters.exclude[MissingClassProblem]("scala.quoted.Quotes$reflectModule$ValOrDefDefMethods"),
49+
ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E4$"),
50+
ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E4$minusmigration$"),
2051
ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E5$"),
2152
ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E5$minusmigration$"),
22-
)
53+
ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$clauseInterleaving$"),
54+
ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$relaxedExtensionImports$"),
55+
ProblemFilters.exclude[MissingClassProblem]("scala.scalajs.runtime.AnonFunctionXXL"),
56+
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.4-migration"),
57+
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.4"),
58+
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.5-migration"),
59+
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.5"),
60+
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.clauseInterleaving"),
61+
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.relaxedExtensionImports"),
62+
),
2363
)
2464
val TastyCore: Seq[ProblemFilter] = Seq(
2565
)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-- Error: tests/neg/context-bounds-migration-3.5.scala:9:2 -------------------------------------------------------------
2+
9 | foo(C[Int]()) // error
3+
| ^^^
4+
| Context bounds will map to context parameters.
5+
| A `using` clause is needed to pass explicit arguments to them.
6+
| This code can be rewritten automatically under -rewrite -source 3.4-migration.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//> using options -source 3.5
2+
3+
class C[T]
4+
def foo[X: C] = ()
5+
6+
given [T]: C[T] = C[T]()
7+
8+
def Test =
9+
foo(C[Int]()) // error
10+
foo(using C[Int]()) // ok
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-- [E050] Type Error: tests/neg/context-bounds-migration-future.scala:9:2 ----------------------------------------------
2+
9 | foo(C[Int]()) // error
3+
| ^^^
4+
| method foo does not take more parameters
5+
|
6+
| longer explanation available when compiling with `-explain`
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//> using options -source future
2+
3+
class C[T]
4+
def foo[X: C] = ()
5+
6+
given [T]: C[T] = C[T]()
7+
8+
def Test =
9+
foo(C[Int]()) // error
10+
foo(using C[Int]()) // ok

tests/neg/i15784.check

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- [E006] Not Found Error: tests/neg/i15784.scala:2:22 -----------------------------------------------------------------
2+
2 | case List(_, Rest @ `a`) => Rest // error
3+
| ^^^
4+
| Not found: a
5+
|
6+
| longer explanation available when compiling with `-explain`
7+
-- [E006] Not Found Error: tests/neg/i15784.scala:3:22 -----------------------------------------------------------------
8+
3 | case List(_, Rest @ A) => Rest // error
9+
| ^
10+
| Not found: A
11+
|
12+
| longer explanation available when compiling with `-explain`

tests/neg/i15784.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
def i15784 = List(42) match
2+
case List(_, Rest @ `a`) => Rest // error
3+
case List(_, Rest @ A) => Rest // error
4+
case _ => ???

0 commit comments

Comments
 (0)