Skip to content

Commit b28d4c1

Browse files
committed
Revert "Take into account the result type of inline implicit conversions unless they are transparent"
This reverts commit eb38e1f.
1 parent 2421581 commit b28d4c1

File tree

6 files changed

+4
-64
lines changed

6 files changed

+4
-64
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import Inferencing.*
1717
import ErrorReporting.*
1818
import util.SourceFile
1919
import TypeComparer.necessarySubType
20-
import dotty.tools.dotc.core.Flags.Transparent
2120

2221
import scala.annotation.internal.sharable
2322
import dotty.tools.dotc.util.Spans.{NoSpan, Span}
@@ -107,14 +106,14 @@ object ProtoTypes {
107106
if !res then ctx.typerState.constraint = savedConstraint
108107
res
109108

110-
/** Constrain result with special case if `meth` is a transparent inlineable method in an inlineable context.
109+
/** Constrain result with special case if `meth` is an inlineable method in an inlineable context.
111110
* In that case, we should always succeed and not constrain type parameters in the expected type,
112111
* because the actual return type can be a subtype of the currently known return type.
113112
* However, we should constrain parameters of the declared return type. This distinction is
114113
* achieved by replacing expected type parameters with wildcards.
115114
*/
116115
def constrainResult(meth: Symbol, mt: Type, pt: Type)(using Context): Boolean =
117-
if (Inlines.isInlineable(meth) && meth.is(Transparent)) {
116+
if (Inlines.isInlineable(meth)) {
118117
constrainResult(mt, wildApprox(pt))
119118
true
120119
}

tests/neg-macros/i18174.scala

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

tests/neg-macros/i9685bis.check

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

tests/neg-macros/i9685bis.scala

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

0 commit comments

Comments
 (0)