Skip to content

Commit

Permalink
Revert "Take into account the result type of inline implicit conversi…
Browse files Browse the repository at this point in the history
…ons unless they are transparent"

This reverts commit eb38e1f.
  • Loading branch information
nicolasstucki committed Mar 11, 2024
1 parent 2421581 commit b28d4c1
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 64 deletions.
2 changes: 1 addition & 1 deletion community-build/community-projects/munit
5 changes: 2 additions & 3 deletions compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import Inferencing.*
import ErrorReporting.*
import util.SourceFile
import TypeComparer.necessarySubType
import dotty.tools.dotc.core.Flags.Transparent

import scala.annotation.internal.sharable
import dotty.tools.dotc.util.Spans.{NoSpan, Span}
Expand Down Expand Up @@ -107,14 +106,14 @@ 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
* achieved by replacing expected type parameters with wildcards.
*/
def constrainResult(meth: Symbol, mt: Type, pt: Type)(using Context): Boolean =
if (Inlines.isInlineable(meth) && meth.is(Transparent)) {
if (Inlines.isInlineable(meth)) {
constrainResult(mt, wildApprox(pt))
true
}
Expand Down
27 changes: 0 additions & 27 deletions tests/neg-macros/i18174.scala

This file was deleted.

9 changes: 0 additions & 9 deletions tests/neg-macros/i9685bis.check

This file was deleted.

23 changes: 0 additions & 23 deletions tests/neg-macros/i9685bis.scala

This file was deleted.

0 comments on commit b28d4c1

Please sign in to comment.