Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #20206 #20210

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package transform

import core.*
import Contexts.*, Symbols.*, Types.*, Annotations.*, Constants.*, Phases.*
import Decorators.*
import StdNames.nme
import ast.untpd
import ast.tpd.*
Expand Down Expand Up @@ -115,11 +116,9 @@ object ContextFunctionResults:
else tree match
case Select(qual, name) =>
if name == nme.apply then
qual.tpe.nn.dealias match
qual.tpe.nn.widenDealias match
case defn.FunctionTypeOfMethod(mt) if mt.isContextualMethod =>
integrateSelect(qual, n + 1)
case _ if defn.isContextFunctionClass(tree.symbol.maybeOwner) => // for TermRefs
integrateSelect(qual, n + 1)
case _ =>
n > 0 && contextResultCount(tree.symbol) >= n
else
Expand Down
15 changes: 15 additions & 0 deletions tests/pos/i20206.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//> using options -experimental -Yno-experimental

import language.experimental.erasedDefinitions

erased trait A
trait B

def foo1: A ?=> B ?=> Nothing = ???
def foo2: (A, B) ?=> Nothing = ???
def foo3: (B, A) ?=> Nothing = ???

def bar: (A, B) ?=> Nothing =
foo1
foo2
foo3
Loading