summaryrefslogtreecommitdiff
path: root/src/reflect
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2015-08-20 12:28:30 +0200
committerLukas Rytz <lukas.rytz@gmail.com>2015-08-27 09:23:46 +0200
commit617c0923bd6b5d1642d04a03508f063d503776b6 (patch)
tree3fe04388dbbf0d2fd0d3ca5dad482099134f4882 /src/reflect
parent3deb2242cba85a618da88dd98846290f359ab3a6 (diff)
downloadscala-617c0923bd6b5d1642d04a03508f063d503776b6.tar.gz
scala-617c0923bd6b5d1642d04a03508f063d503776b6.tar.bz2
scala-617c0923bd6b5d1642d04a03508f063d503776b6.zip
Store SAM information in ClassBTypes
If a class (trait) is a SAM type, store the name and descriptor of the SAM in the ClassBType's InlineInfo.
Diffstat (limited to 'src/reflect')
-rw-r--r--src/reflect/scala/reflect/internal/Definitions.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/Definitions.scala b/src/reflect/scala/reflect/internal/Definitions.scala
index 02fa3c882b..14487a941b 100644
--- a/src/reflect/scala/reflect/internal/Definitions.scala
+++ b/src/reflect/scala/reflect/internal/Definitions.scala
@@ -795,7 +795,9 @@ trait Definitions extends api.StandardDefinitions {
* The class defining the method is a supertype of `tp` that
* has a public no-arg primary constructor.
*/
- def samOf(tp: Type): Symbol = if (!settings.Xexperimental) NoSymbol else {
+ def samOf(tp: Type): Symbol = if (!settings.Xexperimental) NoSymbol else findSam(tp)
+
+ def findSam(tp: Type): Symbol = {
// if tp has a constructor, it must be public and must not take any arguments
// (not even an implicit argument list -- to keep it simple for now)
val tpSym = tp.typeSymbol