Skip to content

Rename documentation references of 'compilation unit' to 'source file'. #12481

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
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
2 changes: 1 addition & 1 deletion docs/docs/reference/other-new-features/open-classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ to mock classes in tests, or to apply temporary patches that add features or fix

### Relationship with `sealed`

A class that is neither `abstract` nor `open` is similar to a `sealed` class: it can still be extended, but only in the same compilation unit. The difference is what happens if an extension of the class is attempted in another compilation unit. For a `sealed` class, this is an error, whereas for a simple non-open class, this is still permitted provided the `adhocExtensions` feature is enabled, and it gives a warning otherwise.
A class that is neither `abstract` nor `open` is similar to a `sealed` class: it can still be extended, but only in the same source file. The difference is what happens if an extension of the class is attempted in another source file. For a `sealed` class, this is an error, whereas for a simple non-open class, this is still permitted provided the `adhocExtensions` feature is enabled, and it gives a warning otherwise.

### Migration

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/usage/language-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The default Scala language version currently supported by the Dotty compiler is
There are two ways to specify a language version.

- With a `-source` command line setting, e.g. `-source 3.0-migration`.
- With a `scala.language` import at the top of a compilation unit, e.g:
- With a `scala.language` import at the top of a source file, e.g:

```scala
package p
Expand All @@ -30,5 +30,5 @@ import scala.language.`future-migration`
class C { ... }
```

Language imports supersede command-line settings in the compilation units where they are specified. Only one language import specifying a source version is allowed in a compilation unit, and it must come before any definitions in that unit.
Language imports supersede command-line settings in the source files where they are specified. Only one language import specifying a source version is allowed in a source file, and it must come before any definitions in that file.