This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BUILD FAILED | |
/home/jdb/workspaces/public/scala/build.xml:1495: The following error occurred while executing this line: | |
/home/jdb/workspaces/public/scala/build-ant-macros.xml:776: Test suite finished with 2 cases failing: | |
fail - run/origins.scala [output differs]% scalac origins.scala | |
% /usr/lib/jvm/java-8-oracle/jre/bin/java \ | |
-Xms1536M \ | |
-Xmx1536M \ | |
-Xss1M \ | |
-XX:+UseParallelGC \ | |
-classpath \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BUILD FAILED | |
/home/jdb/workspaces/public/scala/build.xml:1495: The following error occurred while executing this line: | |
/home/jdb/workspaces/public/scala/build-ant-macros.xml:776: Test suite finished with 2 cases failing: | |
fail - run/origins.scala [output differs]% scalac origins.scala | |
% /usr/lib/jvm/java-8-oracle/jre/bin/java \ | |
-Xms1536M \ | |
-Xmx1536M \ | |
-Xss1M \ | |
-XX:+UseParallelGC \ | |
-classpath \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BUILD FAILED | |
/home/jdb/workspaces/public/scala/build.xml:1495: The following error occurred while executing this line: | |
/home/jdb/workspaces/public/scala/build-ant-macros.xml:776: Test suite finished with 1 case failing: | |
fail - run/origins.scala [output differs]% scalac origins.scala | |
% /usr/lib/jvm/java-8-oracle/jre/bin/java \ | |
-Xms1536M \ | |
-Xmx1536M \ | |
-Xss1M \ | |
-XX:+UseParallelGC \ | |
-classpath \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### With import, without -feature flag: Compiles: YES | |
$ cat D.scala | |
import language.implicitConversions | |
object D { | |
implicit def i2s(i: Int): String = (i - 1).toString | |
val num: String = 44 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- build/spec/07-implicits.html 2017-02-17 19:59:29.867811207 +0000 | |
+++ build-spec-2.5.3/07-implicits.html 2017-02-17 19:58:10.555811809 +0000 | |
@@ -113,20 +113,20 @@ | |
<p>The following code defines an abstract class of monoids and | |
two concrete implementations, <code>StringMonoid</code> and | |
<code>IntMonoid</code>. The two implementations are marked implicit.</p> | |
-<div class="highlight"><pre><code class="language-scala" data-lang="scala"><span class="k">abstract</span> <span class="k">class</span> <span class="nc">Monoid</span><span class="o">[</span><span class="kt">A</span><span class="o">]</span> <span class="nc">extends</span> <span class="nc">SemiGroup</span><span class="o">[</span><span class="kt">A</span><span class="o">]</span> <span class="o">{</span> | |
- <span class="k">def</span> <span class="n">unit</span><span class="k">:</span> <span class="kt">A</span> | |
- <span class="k">def</span> <span class="n">add</span><span class="o">(</span><span class="n">x</span><span class="k">:</span> <span class="kt"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed trait MsbZero extends Nat { | |
override type inc = MsbOne | |
override type dbl = MsbZero | |
override type half = MsbZero | |
override type add[That <: Nat] = That | |
override type coreT[That <: Nat] = B0[That] | |
override type mult[That <: Nat] = MsbZero | |
override type exp[That <: Nat] = MsbZero | |
override type expflip[That <: Nat] = MsbOne | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed trait Nat { | |
type mult[That <: Nat] <: Nat | |
} | |
sealed trait MsbZero extends Nat { | |
override type mult[That <: Nat] = MsbZero | |
} | |
sealed trait MsbOne extends Nat { | |
override type mult[That <: Nat] = That |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicitly[MsbZero#mult[MsbZero] =:= MsbZero] | |
implicitly[MsbZero#mult[MsbOne] =:= MsbZero] | |
implicitly[MsbOne#mult[MsbZero] =:= MsbZero] | |
implicitly[MsbOne#mult[MsbOne] =:= MsbOne] | |
implicitly[T0#mult[T0] =:= T0] | |
implicitly[T0#mult[T2] =:= T0] | |
implicitly[T0#mult[T4] =:= T0] | |
implicitly[T1#mult[T0] =:= T0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 2 x 3 5 x 7 x 11 x 13 x 17 = 510510 | |
type T510 = T5#mult[T10]#add[T1]#mult[T10] | |
type T510510 = T510#mult[T1000]#add[T510] | |
implicitly[T2#mult[T3]#mult[T5]#mult[T7]#mult[T11]#mult[T13]#mult[T17] =:= T510510] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed trait Nat { | |
type inc <: Nat | |
type dbl <: Nat | |
} | |
sealed trait MsbZero extends Nat { | |
override type inc = MsbOne | |
override type dbl = MsbZero | |
} |
OlderNewer