Skip to content

Commit 2421581

Browse files
committed
Revert "Followup fix to transparent inline conversion (#18130)"
This reverts commit 3de184c.
1 parent f1e3dff commit 2421581

File tree

4 files changed

+3
-78
lines changed

4 files changed

+3
-78
lines changed

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

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import ErrorReporting.*
1818
import util.SourceFile
1919
import TypeComparer.necessarySubType
2020
import dotty.tools.dotc.core.Flags.Transparent
21-
import dotty.tools.dotc.config.{ Feature, SourceVersion }
2221

2322
import scala.annotation.internal.sharable
2423
import dotty.tools.dotc.util.Spans.{NoSpan, Span}
@@ -115,22 +114,9 @@ object ProtoTypes {
115114
* achieved by replacing expected type parameters with wildcards.
116115
*/
117116
def constrainResult(meth: Symbol, mt: Type, pt: Type)(using Context): Boolean =
118-
if (Inlines.isInlineable(meth)) {
119-
// Stricter behaviour in 3.4+: do not apply `wildApprox` to non-transparent inlines
120-
if (Feature.sourceVersion.isAtLeast(SourceVersion.`3.4`)) {
121-
if (meth.is(Transparent)) {
122-
constrainResult(mt, wildApprox(pt))
123-
// do not constrain the result type of transparent inline methods
124-
true
125-
} else {
126-
constrainResult(mt, pt)
127-
}
128-
} else {
129-
// Best-effort to fix https://github.com/scala/scala3/issues/9685 in the 3.3.x series
130-
// while preserving source compatibility as much as possible
131-
val methodMatchedType = constrainResult(mt, wildApprox(pt))
132-
meth.is(Transparent) || methodMatchedType
133-
}
117+
if (Inlines.isInlineable(meth) && meth.is(Transparent)) {
118+
constrainResult(mt, wildApprox(pt))
119+
true
134120
}
135121
else constrainResult(mt, pt)
136122
}

tests/neg/i9685bis.check

Lines changed: 0 additions & 9 deletions
This file was deleted.

tests/neg/i9685bis.scala

Lines changed: 0 additions & 25 deletions
This file was deleted.

tests/pos-macros/i18123.scala

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)