Skip to content

Instantly share code, notes, and snippets.

Error:scalac: Error: org.jetbrains.jps.incremental.scala.remote.ServerException
Error compiling the sbt component 'compiler-interface-2.13.0-M3-52.0'
at sbt.internal.inc.AnalyzingCompiler$.handleCompilationError$1(AnalyzingCompiler.scala:331)
at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$4(AnalyzingCompiler.scala:346)
at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$4$adapted(AnalyzingCompiler.scala:341)
at sbt.io.IO$.withTemporaryDirectory(IO.scala:332)
at sbt.io.IO$.withTemporaryDirectory(IO.scala:340)
at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$2(AnalyzingCompiler.scala:341)
at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$2$adapted(AnalyzingCompiler.scala:335)
at sbt.io.IO$.withTemporaryDirectory(IO.scala:332)
[warn] module not found: org.scala-lang#scala-library;2.12.5-bin-7e45827-SNAPSHOT
[warn] ==== local: tried
[warn] C:\Users\soronpo\.ivy2\local\org.scala-lang\scala-library\2.12.5-bin-7e45827-SNAPSHOT\ivys\ivy.xml
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.5-bin-7e45827-SNAPSHOT/scala-library-2.12.5-bin-7e45827-SNAPSHOT.pom
[info] Resolving org.scala-lang#scala-reflect;2.12.5-bin-7e45827-SNAPSHOT ...
[warn] module not found: org.scala-lang#scala-reflect;2.12.5-bin-7e45827-SNAPSHOT
[warn] ==== local: tried
[warn] C:\Users\soronpo\.ivy2\local\org.scala-lang\scala-reflect\2.12.5-bin-7e45827-SNAPSHOT\ivys\ivy.xml
[warn] ==== public: tried
@soronpo
soronpo / CanBuildFrom.md
Last active December 18, 2018 06:22
Scala Collections CanBuildFrom explanation by Stefan Zeiger @szeiger

Taken from https://gitter.im/scala/contributors?at=5c0981af80986419d54dd08d

Stefan Zeiger @szeiger:

I'll try to give a high-level explanation (with imprecise types): In order to build something (like the result of 1.to(10).map(identity)) you use a Builder[E, To] to which you add elements of type E and eventually get a result To. That way a single implementation of map can build different result types. In order to get such a Builder you need a factory, i.e. a () => Builder[E, To]. We call this type CanBuild and pass an implicit instance of it to map. You usually don't care who's doing the building (Range in this case) but for the sake of finding an implicit CanBuild you want the source collection to determine the result type To (e.g. calling map on a List should build another List).

2019-12-24 00:34:03
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.231-b11 mixed mode):
"classloader-cache-cleanup-0" #13 daemon prio=5 os_prio=0 tid=0x00000000560d6000 nid=0x41c in Object.wait() [0x000000005b2ef000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c14784a8> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
- locked <0x00000000c14784a8> (a java.lang.ref.ReferenceQueue$Lock)
at sbt.internal.classpath.ClassLoaderCache$CleanupThread.run(ClassLoaderCache.scala:102)
@soronpo
soronpo / CPU.scala
Last active September 29, 2021 12:49
//This is a DFiant-equivalent design of https://github.com/tommythorn/silice-examples/blob/master/cpu.ice
import DFiant.*
class CPU(using DFC) extends DFDesign:
val leds = DFBits(8) <> OUT
val rf = DFBits(32).X(16) <> VAR init Vector(
0, 1, 1, 0, 100, 0, 1
).padTo(16, 0).map(_.toBits(32))
// A add, B blt
val code = DFBits(32).X(32) const Vector(
@soronpo
soronpo / gist:64d5548fb5a544e3b9d9d4f1717b4722
Created October 17, 2021 12:47
Full stack trace error
error] dotty.tools.dotc.core.Denotations$StaleSymbol: stale symbol; type OutW#32239 in trait CompanionsDFBits$Token$Candidate, defined in Period(1..55, run = 2), is referred to in run Period(1..1, run = 3)
[error] dotty.tools.dotc.core.Denotations$SingleDenotation.staleSymbolError(Denotations.scala:955)
[error] dotty.tools.dotc.core.Denotations$SingleDenotation.bringForward(Denotations.scala:754)
[error] dotty.tools.dotc.core.Denotations$SingleDenotation.toNewRun$1(Denotations.scala:803)
[error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:877)
[error] dotty.tools.dotc.core.Symbols$Symbol.recomputeDenot(Symbols.scala:122)
[error] dotty.tools.dotc.core.Symbols$Symbol.computeDenot(Symbols.scala:116)
[error] dotty.tools.dotc.core.Symbols$Symbol.denot(Symbols.scala:109)
[error] dotty.tools.dotc.core.Symbols$.toDenot(Symbols.scala:494)
[error] dotty.tools.dotc.core.Types$NamedType.derivedSelect(Types.scala:2493)
```
Exception in thread "pool-5-thread-2" java.lang.AssertionError: assertion failed: asTerm called on not-a-Term val <none>
at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
at dotty.tools.dotc.core.Symbols$Symbol.asTerm(Symbols.scala:163)
at dotty.tools.dotc.ast.tpd$.New(tpd.scala:494)
at dotty.tools.dotc.core.Annotations$Annotation$.apply(Annotations.scala:191)
at dotty.tools.dotc.core.Annotations$Annotation$.apply(Annotations.scala:182)
at dotty.tools.dotc.core.classfile.ClassfileParser.parseAttribute$1(ClassfileParser.scala:734)
at dotty.tools.dotc.core.classfile.ClassfileParser.parseAttributes$$anonfun$1(ClassfileParser.scala:792)
at scala.runtime.java8.JFunction1$mcVI$sp.apply(JFunction1$mcVI$sp.scala:18)
@soronpo
soronpo / AES.scala
Created December 22, 2022 14:57
DFiant HDL AES Encryption
package AES
import dfhdl.{apply => _, *}
export dfhdl.apply
import scala.annotation.targetName
//////////////////////////////////////////////////////////////////////////////////////////////////////
// AES Byte
//////////////////////////////////////////////////////////////////////////////////////////////////////