Skip to content

Commit

Permalink
Merge pull request scala#12481 from megri/rename-compilation-unit-to-…
Browse files Browse the repository at this point in the history
…source-file-in-docs

Rename documentation references of 'compilation unit' to 'source file'.
  • Loading branch information
smarter authored Jun 14, 2021
2 parents aa9d526 + 596e6df commit 229ec59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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.

0 comments on commit 229ec59

Please sign in to comment.