From d0dd7001f0b59ed53f0778530328b3bf413587a2 Mon Sep 17 00:00:00 2001 From: Sébastien Doeraene Date: Mon, 7 Mar 2016 14:46:45 +0100 Subject: Implement most of the Scala.js IR code generator. Notable things that are missing at this point: * Pattern matching * Try * Most of the JavaScript interop --- src/dotty/tools/dotc/config/SJSPlatform.scala | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/dotty/tools/dotc/config/SJSPlatform.scala') diff --git a/src/dotty/tools/dotc/config/SJSPlatform.scala b/src/dotty/tools/dotc/config/SJSPlatform.scala index fec9c25a1..3ec8049ae 100644 --- a/src/dotty/tools/dotc/config/SJSPlatform.scala +++ b/src/dotty/tools/dotc/config/SJSPlatform.scala @@ -2,6 +2,7 @@ package dotty.tools.dotc.config import dotty.tools.dotc.core._ import Contexts._ +import Symbols._ import dotty.tools.backend.sjs.JSDefinitions @@ -10,4 +11,8 @@ class SJSPlatform()(implicit ctx: Context) extends JavaPlatform { /** Scala.js-specific definitions. */ val jsDefinitions: JSDefinitions = new JSDefinitions() + /** Is the SAMType `cls` also a SAM under the rules of the Scala.js back-end? */ + override def isSam(cls: ClassSymbol)(implicit ctx: Context): Boolean = + defn.isFunctionClass(cls) || jsDefinitions.isJSFunctionClass(cls) + } -- cgit v1.2.3