-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor CannotBeAccessed/isAccessibleFrom
- Loading branch information
1 parent
231ca72
commit 8aec15b
Showing
4 changed files
with
38 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
-- [E173] Reference Error: tests/neg/i18686.scala:9:16 ----------------------------------------------------------------- | ||
9 | println(Foo.Bar1) // error | ||
| ^^^^^^^^ | ||
| value Bar1 cannot be accessed as a member of Foo.type from object Main. | ||
-- [E173] Reference Error: tests/neg/i18686.scala:10:16 ---------------------------------------------------------------- | ||
10 | println(Foo.Bar2) // error | ||
| ^^^^^^^^ | ||
| value Bar2 cannot be accessed as a member of Foo.type from object Main. | ||
-- [E173] Reference Error: tests/neg/i18686.scala:11:16 ---------------------------------------------------------------- | ||
11 | println(Foo.Bar3) // error | ||
| ^^^^^^^^ | ||
| value Bar3 cannot be accessed as a member of Foo.type from object Main. | ||
| Protected value Bar3 can only be accessed from object Foo. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
object Foo: | ||
private val Bar1: Int = 3 | ||
private[Foo] val Bar2: Int = 3 | ||
protected val Bar3: Int = 3 | ||
end Foo | ||
|
||
object Main: | ||
def main(args: Array[String]): Unit = | ||
println(Foo.Bar1) // error | ||
println(Foo.Bar2) // error | ||
println(Foo.Bar3) // error | ||
end main | ||
end Main |