Skip to content

tweak: snippet compiler settings #19497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions library/src/scala/quoted/Quotes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1637,10 +1637,11 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
* val q: Quotes = summon[Quotes]
* import q.reflect._
* //}
* val intArgs = List(Literal(Constant(1)), Literal(Constant(2)))
* val intArgs = List(Literal(IntConstant(1)), Literal(IntConstant(2)))
* Typed(
* Repeated(intArgs, TypeTree.of[Int]),
* Inferred(defn.RepeatedParamClass.typeRef.appliedTo(TypeRepr.of[Int]))
* Repeated(intArgs, TypeTree.of[Int]),
* Inferred(defn.RepeatedParamClass.typeRef.appliedTo(TypeRepr.of[Int]))
* )
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing )

* //{
* }
* //}
Expand Down
16 changes: 9 additions & 7 deletions library/src/scala/util/boundary.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ import scala.annotation.implicitNotFound
* be rewritten to jumps.
*
* Example usage:
*
* ```scala
* import scala.util.boundary, boundary.break
*
* import scala.util.boundary, boundary.break
*
* def firstIndex[T](xs: List[T], elem: T): Int =
* boundary:
* for (x, i) <- xs.zipWithIndex do
* if x == elem then break(i)
* -1
* def firstIndex[T](xs: List[T], elem: T): Int =
* boundary:
* for (x, i) <- xs.zipWithIndex do
* if x == elem then break(i)
* -1
* ```
*/
object boundary:

Expand Down
9 changes: 7 additions & 2 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2359,7 +2359,10 @@ object ScaladocConfigs {
.add(VersionsDictionaryUrl("https://scala-lang.org/api/versions.json"))
.add(DocumentSyntheticTypes(true))
.add(SnippetCompiler(List(
s"${dottyLibRoot}/scala=compile",
s"$dottyLibRoot/src/scala=compile",
s"$dottyLibRoot/src/scala/compiletime=compile",
s"$dottyLibRoot/src/scala/util=compile",
s"$dottyLibRoot/src/scala/util/control=compile"
)))
.add(SiteRoot("docs"))
.add(ApiSubdirectory(true))
Expand All @@ -2375,7 +2378,9 @@ object ScaladocConfigs {
.add(SnippetCompiler(
List(
s"$dottyLibrarySrc/scala/quoted=compile",
s"$dottyLibrarySrc/scala/compiletime=compile"
s"$dottyLibrarySrc/scala/compiletime=compile",
s"$dottyLibrarySrc/scala/util=compile",
s"$dottyLibrarySrc/scala/util/control=compile"
)
))
.add(CommentSyntax(List(
Expand Down