@@ -18,7 +18,6 @@ import ErrorReporting.*
18
18
import util .SourceFile
19
19
import TypeComparer .necessarySubType
20
20
import dotty .tools .dotc .core .Flags .Transparent
21
- import dotty .tools .dotc .config .{ Feature , SourceVersion }
22
21
23
22
import scala .annotation .internal .sharable
24
23
import dotty .tools .dotc .util .Spans .{NoSpan , Span }
@@ -115,22 +114,9 @@ object ProtoTypes {
115
114
* achieved by replacing expected type parameters with wildcards.
116
115
*/
117
116
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
134
120
}
135
121
else constrainResult(mt, pt)
136
122
}
0 commit comments