Skip to content

Conversation

@odersky
Copy link
Contributor

@odersky odersky commented Jul 20, 2017

If just one of a number of alternatives takes a SAM, allow a lambda argument,
just like we do for non-overloaded methods with SAM type parameters.

If just one of a number of alternatives takes a SAM, allow a lambda argument,
just like we do for non-overloaded methods with SAM type parameters.
Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

case SAMType(meth) => argtpe <:< meth.info.toFunctionType()
case _ => false
}
isCompatible(argtpe, formal) || ctx.mode.is(Mode.ImplicitsEnabled) && SAMargOK
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add some note that implicit search and SAM conversion are tried at the same time to justify checking ImplicitsEnabled here?

@DarkDimius DarkDimius merged commit 9018807 into scala:master Jul 25, 2017
@allanrenucci allanrenucci deleted the fix-#2367 branch December 14, 2017 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants