Skip to content

Commit 18ac691

Browse files
committed
Fix typos and address review sugesions
1 parent fd67fc1 commit 18ac691

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

compiler/src/dotty/tools/dotc/config/Feature.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ object Feature:
264264
if previewSym.exists
265265
then i"$previewSym is marked @preview$msg"
266266
else i"$sym inherits @preview$msg"
267-
report.error(markedPreview + "\n\n" + previewUseSite("definition"), srcPos)
267+
report.error(i"${markedPreview}\n\n${previewUseSite("definition")}", srcPos)
268268

269269
private def previewUseSite(which: String): String =
270270
s"Preview $which may only be used when compiling with the `-preview` compiler flag"

docs/_docs/reference/other-new-features/preview-defs.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ nightlyOf: https://docs.scala-lang.org/scala3/reference/other-new-features/previ
66

77
New Scala language features or standard library APIs are initially introduced as experimental, but once they become fully implemented and acceppted by the [SIP](https://docs.scala-lang.org/sips/) these can become a preview features.
88
Preview language features and APIs are guaranteed to be standarized in some next Scala minor release, but allow compiler team to introduce small, possibly binary incompatible, changes based on the community feedback.
9-
These can be used by early adopters who can accept possibility of binary compatibility breakage. As an example these can be used for project internal tools and applications, but are discouraged to be used by libraries.
9+
These can be used by early adopters who can accept the possibility of binary compatibility breakage. For instance, preview features could be used in some internal tool or application. On the other hand, preview features are discouraged in publicly available libraries.
1010

11-
Users can enable access to preview features and definitions by compiling with `-preview` flag. The flag would enable all preview features and definitions. There is no way for enabling only a subset of preview features.
11+
Users can enable access to preview features and definitions by compiling with the `-preview` flag. The flag would enable all preview features and definitions. There is no scheme for enabling only a subset of preview features.
1212

13-
The biggest difference of preview features when compared with experimental features is their non-viral behaviour.
14-
Any defintion compiled in the preview mode (using `-preview` flag) is not marked as preview defintion itself.
13+
The biggest difference of preview features compared to experimental features is their non-viral behaviour.
14+
A definition compiled in preview mode (using the `-preview` flag) is not marked as a preview definition itself.
1515
This behaviour allows to use preview features transitively in other compilation units without explicitlly enabled preview mode, as long as it does not directly reference APIs or features marked as preview.
1616

17-
The [`@preview`](https://scala-lang.org/api/3.x/scala/annotation/internal/preview.html) annotations are used to mark Scala 3 standard library APIs currently available under enabled preview mode.
18-
The definitions follows similar rules as the [`@experimental`](https://scala-lang.org/api/3.x/scala/annotation/experimental.html) when it comes to accessing, subtyping, overriding or overloading definitions marked with this annotation - all of these can only be performed in compilation unit that enables preview mode.
17+
The [`@preview`](https://scala-lang.org/api/3.x/scala/annotation/internal/preview.html) annotation is used to mark Scala 3 standard library APIs currently available under preview mode.
18+
The rules for `@preview` are similar to [`@experimental`](https://scala-lang.org/api/3.x/scala/annotation/experimental.html) when it comes to accessing, subtyping, overriding or overloading definitions marked with this annotation - all of these can only be performed in compilation units that enable preview mode.
1919

2020
```scala
2121
//> using options -preview

0 commit comments

Comments
 (0)