Skip to content

Instantly share code, notes, and snippets.

View return-in-scala-3-compiler.txt
-- Warning: compiler/src/dotty/tools/dotc/typer/Applications.scala:1087:6 ------
[wartremover:Return] return is disabledctorTest 5s
-- Warning: compiler/src/dotty/tools/dotc/typer/Applications.scala:1241:43 -----
[wartremover:Return] return is disabled
-- Warning: compiler/src/dotty/tools/dotc/typer/Applications.scala:1784:34 -----
[wartremover:Return] return is disabled
-- Warning: compiler/src/dotty/tools/dotc/typer/Applications.scala:1786:12 -----
[wartremover:Return] return is disabled
-- Warning: compiler/src/dotty/tools/dotc/typer/Checking.scala:429:6 -----------
[wartremover:Return] return is disabled
View A.scala
sealed abstract class Y
class Y1 extends Y
class Y2 extends Y
sealed abstract class X[B](val value: Int)
case object X1 extends X[Y1](1)
case object X2 extends X[Y2](2)
View orphan-parameter-reference.txt
Welcome to Scala 3.1.1 (1.8.0_322, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
scala> import scala.quoted.*
scala> def a[A](f : [x <: Quotes] => (x: x) => x.reflect.Tree => A): A = ???
def a[A](f: [x <: quoted.Quotes] => (x: x) => x.reflect.Tree => A): A
scala> a([x <: Quotes] => (x: x) => (tree: x.reflect.Tree) => tree.symbol)
error when pickling type x.type
View Scala-3-TASTy-inspector-CyclicReference.txt
[error] dotty.tools.dotc.core.CyclicReference:
[error] at dotty.tools.dotc.core.CyclicReference$.apply(TypeErrors.scala:155)
[error] at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:165)
[error] at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:187)
[error] at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:189)
[error] at dotty.tools.dotc.core.classfile.ClassfileParser$innerClasses$.getMember$1(ClassfileParser.scala:1118)
[error] at dotty.tools.dotc.core.classfile.ClassfileParser$innerClasses$.classSymbol(ClassfileParser.scala:1130)
[error] at dotty.tools.dotc.core.classfile.ClassfileParser.classNameToSymbol(ClassfileParser.scala:117)
[error] at dotty.tools.dotc.core.classfile.ClassfileParser.sig2type$1(ClassfileParser.scala:426)
[error] at dotty.tools.dotc.core.classfile.ClassfileParser.processTypeArgs$1(ClassfileParser.scala:413)
View TASTy-inspector-ArrayIndexOutOfBoundsException.txt
[error] java.lang.ArrayIndexOutOfBoundsException: 9
[error] at scala.collection.mutable.AnyRefMap.seekEntry(AnyRefMap.scala:126)
[error] at scala.collection.mutable.AnyRefMap.get(AnyRefMap.scala:151)
[error] at scala.collection.mutable.Map$WithDefault.get(Map.scala:247)
[error] at scala.collection.MapOps.apply(Map.scala:175)
[error] at scala.collection.MapOps.apply$(Map.scala:175)
[error] at scala.collection.AbstractMap.apply(Map.scala:405)
[error] at dotty.tools.dotc.util.FreshNameCreator$Default.newName(FreshNameCreator.scala:26)
[error] at dotty.tools.dotc.core.NameKinds$UniqueNameKind.fresh(NameKinds.scala:222)
[error] at dotty.tools.dotc.core.NameKinds$UniqueNameKind.fresh(NameKinds.scala:226)
@xuwei-k
xuwei-k / InliningProfile.scala
Last active Mar 30, 2022
Scala 3 inlining phase profile compiler plugin
View InliningProfile.scala
package example
import dotty.tools.dotc.CompilationUnit
import dotty.tools.dotc.core.Contexts.Context
import dotty.tools.dotc.core.Phases.Phase
import dotty.tools.dotc.plugins.ResearchPlugin
import dotty.tools.dotc.transform.Inlining
class InliningProfile extends ResearchPlugin {
override val name: String = "my-inlining"
View WartremoverTastyInspector.scala
package example
import org.wartremover.LogLevel
import org.wartremover.WartTraverser
import org.wartremover.WartUniverse
import scala.quoted.Quotes
import scala.tasty.inspector.Inspector
import scala.tasty.inspector.Tasty
import scala.tasty.inspector.TastyInspector
@xuwei-k
xuwei-k / gist:52838ed0546cedf9dc1a1ae3d13816a5
Created Mar 26, 2022
wartremover SizeIs scala3-compiler.jar 3.1.3-RC1-bin-20220325-6f3fe05-NIGHTLY
View gist:52838ed0546cedf9dc1a1ae3d13816a5
[error] -- Warning: library/src/scala/runtime/stdLibPatches/Predef.scala:7:8 -----------
[error] [wartremover:SizeIs] Maybe you can use `sizeIs` instead of `size`
[error] -- Warning: library/src/scala/runtime/stdLibPatches/Predef.scala:10:8 ----------
[error] [wartremover:SizeIs] Maybe you can use `sizeIs` instead of `size`
[error] -- Warning: compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala:328:46 ---
[error] [wartremover:SizeIs] Maybe you can use `sizeIs` instead of `size`
[error] -- Warning: out/bootstrap/scala3-compiler-bootstrapped/scala-3.1.3-RC1-bin-20220325-6f3fe05-NIGHTLY-nonbootstrapped/src_managed/main/scalajs-ir-src/org/scalajs/ir/Trees.scala:454:32
[error] [wartremover:SizeIs] Maybe you can use `sizeIs` instead of `size`
[error] -- Warning: compiler/src/dotty/tools/MainGenericRunner.scala:114:42 ------------
[error] [wartremover:SizeIs] Maybe you can use `sizeIs` instead of `size`
View TypeLevelSortString.scala
import scala.compiletime.ops.string.{+, Substring, Length}
import scala.compiletime.ops.int.{<, >}
import scala.compiletime.ops.int
sealed trait HList {
def ::[T](t: T): T :: this.type = new ::(t, this)
}
final case class ::[H, +T <: HList](h: H, t: T) extends HList
sealed trait HNil extends HList
View build.sbt
import sbtprojectgraph._
import scala.sys.process.Process
import scala.collection.JavaConverters.*
lazy val a0 = project
.dependsOn(
a7,
a1
)