diff options
author | Sébastien Doeraene <sjrdoeraene@gmail.com> | 2016-03-05 01:08:18 +0100 |
---|---|---|
committer | Sébastien Doeraene <sjrdoeraene@gmail.com> | 2016-03-07 14:41:36 +0100 |
commit | c14c9c096d09d9e21f1fd4ec27e6b416db01512f (patch) | |
tree | 628838c31d6d2ca6c46bb5591882501cdb608030 /src/dotty/tools/dotc/config/Platform.scala | |
parent | a50926701ef5171779aa025d2d307751d166cabe (diff) | |
download | dotty-c14c9c096d09d9e21f1fd4ec27e6b416db01512f.tar.gz dotty-c14c9c096d09d9e21f1fd4ec27e6b416db01512f.tar.bz2 dotty-c14c9c096d09d9e21f1fd4ec27e6b416db01512f.zip |
Move the logic of ExpandSAMs.isJvmSam to Platform.isSam.
Whether a language SAM type is also a valid SAM type for the
back-end is a platform-specific thing. On Scala.js, for example,
the rules are completely different than for the JVM.
This commit therefore moves the logic of the predicate used by
ExpandSAMs to decide whether to expand a SAM as an anonymous class
to the Platform.
Diffstat (limited to 'src/dotty/tools/dotc/config/Platform.scala')
-rw-r--r-- | src/dotty/tools/dotc/config/Platform.scala | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/config/Platform.scala b/src/dotty/tools/dotc/config/Platform.scala index 972892d12..062d9002d 100644 --- a/src/dotty/tools/dotc/config/Platform.scala +++ b/src/dotty/tools/dotc/config/Platform.scala @@ -27,6 +27,9 @@ abstract class Platform { /** Any platform-specific phases. */ //def platformPhases: List[SubComponent] + /** Is the SAMType `cls` also a SAM under the rules of the platform? */ + def isSam(cls: ClassSymbol)(implicit ctx: Context): Boolean + /** The various ways a boxed primitive might materialize at runtime. */ def isMaybeBoxed(sym: ClassSymbol)(implicit ctx: Context): Boolean |