Skip to content

Commit 68c88eb

Browse files
committed
Scala3doc: document stdlib together with Dotty extensions
1 parent 0f0137e commit 68c88eb

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,12 @@ trait TypeAssigner {
299299
else fntpe.resultType
300300
else
301301
errorType(i"wrong number of arguments at ${ctx.phase.prev} for $fntpe: ${fn.tpe}, expected: ${fntpe.paramInfos.length}, found: ${args.length}", tree.srcPos)
302+
case t if args.isEmpty =>
303+
// NOTE this case is necessary when loading the stdlib from Tasty. Our extensions are compiled with stdlib loaded
304+
// from Scala2 classfiles while they are loaded with stdlib loaded from Tasty. This results in `def toString` being
305+
// typed as MethodType in the first case and ExprType in the second case. In the second case (and, I think, only then)
306+
// we need to handle ExprType being present here.
307+
t
302308
case t =>
303309
if (ctx.settings.Ydebug.value) new FatalError("").printStackTrace()
304310
errorType(err.takesNoParamsStr(fn, ""), tree.srcPos)

project/Build.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,7 +1491,7 @@ object Build {
14911491
}
14921492

14931493
def joinProducts(products: Seq[java.io.File]): String =
1494-
products.iterator.map(_.getAbsolutePath.toString).mkString(java.io.File.pathSeparator)
1494+
products.iterator.map(_.getAbsolutePath.toString).mkString(" ")
14951495

14961496
val dokkaVersion = "1.4.10.2"
14971497

@@ -1539,7 +1539,7 @@ object Build {
15391539
(`scala3-library-bootstrapped`/Compile/products).value,
15401540
).flatten
15411541

1542-
val roots = dottyJars.mkString(" ")
1542+
val roots = joinProducts(dottyJars)
15431543

15441544
if (dottyJars.isEmpty) Def.task { streams.value.log.error("Dotty lib wasn't found") }
15451545
else Def.task{
@@ -1555,6 +1555,7 @@ object Build {
15551555

15561556
generateScala3StdlibDocumentation:= Def.taskDyn {
15571557
val dottyJars: Seq[java.io.File] = Seq(
1558+
(`scala3-library-bootstrapped`/Compile/products).value,
15581559
(`stdlib-bootstrapped`/Compile/products).value,
15591560
).flatten
15601561

0 commit comments

Comments
 (0)