Commit 54fab4d
committed
Band-aidy fix for ClassCastException on malformed programs
To typecheck
```scala
class Foo extends someTree
```
we need to detect correctly if `someTree` should be typechecked as a term or a
type; `Int => 1` should be typechecked as a type, even though it looks like a
term according to `isTerm`.
Really, we shouldn't use isType at all, because the user might write a type in
place of a term or viceversa. I think we only want to know this is a constructor
call or a type; and maybe we should just let the parser tell us which, since it
knows.1 parent 1947222 commit 54fab4d
File tree
5 files changed
+30
-1
lines changed- compiler/src/dotty/tools/dotc/typer
- tests
- neg
- pos
5 files changed
+30
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1593 | 1593 | | |
1594 | 1594 | | |
1595 | 1595 | | |
1596 | | - | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
1597 | 1603 | | |
1598 | 1604 | | |
1599 | 1605 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments