diff --git a/community-build/community-projects/munit b/community-build/community-projects/munit index c18fddb143b9..5c77d7316fc6 160000 --- a/community-build/community-projects/munit +++ b/community-build/community-projects/munit @@ -1 +1 @@ -Subproject commit c18fddb143b98e4c026dc118687410d52b187d88 +Subproject commit 5c77d7316fc66adaed64e9532ee0a45a668b01ec diff --git a/community-build/community-projects/specs2 b/community-build/community-projects/specs2 index ba01cca013d9..a618330aa808 160000 --- a/community-build/community-projects/specs2 +++ b/community-build/community-projects/specs2 @@ -1 +1 @@ -Subproject commit ba01cca013d9d99e390d17619664bdedd716e0d7 +Subproject commit a618330aa80833787859dae805d02e45d4304c42 diff --git a/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala b/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala index c8012bef0904..46c12b244fbb 100644 --- a/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala +++ b/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala @@ -17,8 +17,6 @@ import Inferencing.* import ErrorReporting.* import util.SourceFile import TypeComparer.necessarySubType -import dotty.tools.dotc.core.Flags.Transparent -import dotty.tools.dotc.config.{ Feature, SourceVersion } import scala.annotation.internal.sharable import dotty.tools.dotc.util.Spans.{NoSpan, Span} @@ -108,7 +106,7 @@ object ProtoTypes { if !res then ctx.typerState.constraint = savedConstraint res - /** Constrain result with special case if `meth` is a transparent inlineable method in an inlineable context. + /** Constrain result with special case if `meth` is an inlineable method in an inlineable context. * In that case, we should always succeed and not constrain type parameters in the expected type, * because the actual return type can be a subtype of the currently known return type. * However, we should constrain parameters of the declared return type. This distinction is @@ -116,21 +114,8 @@ object ProtoTypes { */ def constrainResult(meth: Symbol, mt: Type, pt: Type)(using Context): Boolean = if (Inlines.isInlineable(meth)) { - // Stricter behaviour in 3.4+: do not apply `wildApprox` to non-transparent inlines - if (Feature.sourceVersion.isAtLeast(SourceVersion.`3.4`)) { - if (meth.is(Transparent)) { - constrainResult(mt, wildApprox(pt)) - // do not constrain the result type of transparent inline methods - true - } else { - constrainResult(mt, pt) - } - } else { - // Best-effort to fix https://github.com/scala/scala3/issues/9685 in the 3.3.x series - // while preserving source compatibility as much as possible - val methodMatchedType = constrainResult(mt, wildApprox(pt)) - meth.is(Transparent) || methodMatchedType - } + constrainResult(mt, wildApprox(pt)) + true } else constrainResult(mt, pt) } diff --git a/tests/neg-macros/i18174.scala b/tests/neg-macros/i18174.scala deleted file mode 100644 index 8bb5ffd51a3f..000000000000 --- a/tests/neg-macros/i18174.scala +++ /dev/null @@ -1,27 +0,0 @@ -// does not compile anymore in Scala 3.4+ -package pkg - -import scala.language.`3.4` - -trait P[+T] - -extension [T](inline parse0: P[T]) - inline def | [V >: T](inline other: P[V]): P[V] = ??? - -extension [T](inline parse0: => P[T]) - inline def rep[V](inline min: Int = 0)(using repeater: Implicits.Repeater[T, V]): P[V] = ??? - -object Implicits: - trait Repeater[-T, R] - object Repeater: - implicit def GenericRepeaterImplicit[T]: Repeater[T, Seq[T]] = ??? - -sealed trait RegexTree -abstract class Node extends RegexTree -class CharClassIntersection() extends Node - -def classItem: P[RegexTree] = ??? -def charClassIntersection: P[CharClassIntersection] = ??? - -def x = - (charClassIntersection.rep() | classItem.rep()) // error diff --git a/tests/neg-macros/i9685bis.check b/tests/neg-macros/i9685bis.check deleted file mode 100644 index 45e7f85aa30d..000000000000 --- a/tests/neg-macros/i9685bis.check +++ /dev/null @@ -1,9 +0,0 @@ --- [E008] Not Found Error: tests/neg-macros/i9685bis.scala:23:4 -------------------------------------------------------- -23 | 1.asdf // error - | ^^^^^^ - | value asdf is not a member of Int, but could be made available as an extension method. - | - | The following import might make progress towards fixing the problem: - | - | import foo.Baz.toBaz - | diff --git a/tests/neg-macros/i9685bis.scala b/tests/neg-macros/i9685bis.scala deleted file mode 100644 index 0023d4d719b4..000000000000 --- a/tests/neg-macros/i9685bis.scala +++ /dev/null @@ -1,23 +0,0 @@ -package foo - -import scala.language.implicitConversions - -class Foo - -object Foo: - - inline implicit def toFoo(x: Int): Foo = Foo() - -class Bar - -object Bar: - inline given Conversion[Int, Bar] with - def apply(x: Int): Bar = Bar() - -class Baz - -object Baz: - transparent inline implicit def toBaz(x: Int): Baz = Baz() - -object Usage: - 1.asdf // error diff --git a/tests/neg/i9685bis.check b/tests/neg/i9685bis.check deleted file mode 100644 index 1cc81df9987c..000000000000 --- a/tests/neg/i9685bis.check +++ /dev/null @@ -1,9 +0,0 @@ --- [E008] Not Found Error: tests/neg/i9685bis.scala:25:4 --------------------------------------------------------------- -25 | 1.asdf // error - | ^^^^^^ - | value asdf is not a member of Int, but could be made available as an extension method. - | - | The following import might make progress towards fixing the problem: - | - | import foo.Baz.toBaz - | diff --git a/tests/neg/i9685bis.scala b/tests/neg/i9685bis.scala deleted file mode 100644 index 0a3e245fe738..000000000000 --- a/tests/neg/i9685bis.scala +++ /dev/null @@ -1,25 +0,0 @@ -//> using options -source future - -package foo - -import scala.language.implicitConversions - -class Foo - -object Foo: - - inline implicit def toFoo(x: Int): Foo = Foo() - -class Bar - -object Bar: - inline given Conversion[Int, Bar] with - def apply(x: Int): Bar = Bar() - -class Baz - -object Baz: - transparent inline implicit def toBaz(x: Int): Baz = Baz() - -object Usage: - 1.asdf // error diff --git a/tests/pos-macros/i18123.scala b/tests/pos/i18123.scala similarity index 95% rename from tests/pos-macros/i18123.scala rename to tests/pos/i18123.scala index d9127a918ee8..714850004d2c 100644 --- a/tests/pos-macros/i18123.scala +++ b/tests/pos/i18123.scala @@ -1,8 +1,6 @@ // may not compile anymore in Scala 3.4+ package pkg -import scala.language.`3.3` - trait P[+T] extension [T](inline parse0: P[T])