Commit 230925d
Check protected parent constructor accesses only occurs in child constructors (scala#25511)
Fixes scala#25442.
Currently, protected parent class constructor calls that occur outside
of their subclass constructors are not properly checked. So it possible
to call a parent constructor in any method of subclass. This change
checks that such accesses only occur inside subclass constructors.
No LLM-based tools were used.
negative test case from issue included.
Co-authored-by: James You <jyou@protonmail.com>1 parent 3be6338 commit 230925d
File tree
2 files changed
+12
-2
lines changed- compiler/src/dotty/tools/dotc/core
- tests/neg/i25442
2 files changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
946 | 946 | | |
947 | 947 | | |
948 | 948 | | |
949 | | - | |
| 949 | + | |
| 950 | + | |
950 | 951 | | |
951 | 952 | | |
952 | | - | |
| 953 | + | |
| 954 | + | |
953 | 955 | | |
954 | 956 | | |
955 | 957 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments