Skip to content

Commit af5eab2

Browse files
committed
Fix #12351: add test
1 parent 3a91d2f commit af5eab2

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ class BootstrappedOnlyCompilationTests {
118118
aggregateTests(
119119
compileFilesInDir("tests/run-macros", defaultOptions.and("-Xcheck-macros")),
120120
compileFilesInDir("tests/run-custom-args/Yretain-trees", defaultOptions and "-Yretain-trees"),
121+
compileFilesInDir("tests/run-custom-args/Yread-comments", defaultOptions and "-Yread-comments"),
121122
compileFilesInDir("tests/run-custom-args/run-macros-erased", defaultOptions.and("-language:experimental.erasedDefinitions").and("-Xcheck-macros")),
122123
)
123124
}.checkRuns()
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import scala.quoted.*
2+
3+
/** HELLO */
4+
case class Data(test: Boolean)
5+
6+
inline def getDocString[T]: Option[String] = ${ getDocStringImpl[T] }
7+
8+
private def getDocStringImpl[T : Type](using Quotes): Expr[Option[String]] = {
9+
import quotes.reflect.*
10+
Expr(TypeRepr.of[T].typeSymbol.docstring)
11+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@main def Test(): Unit = {
2+
println(getDocString[Data])
3+
assert(getDocString[Data].nonEmpty)
4+
}

0 commit comments

Comments
 (0)