@@ -18,7 +18,6 @@ import ErrorReporting.*
1818import util .SourceFile
1919import TypeComparer .necessarySubType
2020import dotty .tools .dotc .core .Flags .Transparent
21- import dotty .tools .dotc .config .{ Feature , SourceVersion }
2221
2322import scala .annotation .internal .sharable
2423import 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 }
0 commit comments