Commit a73a441
authored
trait-parameters.md: delete invalid code from example (#16516)
This code doesn't compile and produces error:
```scala
class F(using iname: ImpliedName) extends
Object,
ImpliedGreeting(using iname),
ImpliedFormalGreeting(using iname)
```
>[error] 15 | ImpliedFormalGreeting(using iname)
>[error] | ^^^^^^^^^^^^^^^^^^^^^
>[error] |constructor ImpliedFormalGreeting in trait
ImpliedFormalGreeting does not take more parameters
>[error]
|----------------------------------------------------------------------------
>[error] | Explanation (enabled by `-explain`)
>[error] |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - -
>[error] | You have specified more parameter lists than defined in the
method definition(s).
This will compile:
```scala
class F(using iname: ImpliedName) extends
Object,
ImpliedGreeting(using iname),
ImpliedFormalGreeting
```
I understand, that maybe this is kinda pseudo-code.
>The definition of `F` in the last line is implicitly expanded to
But if it's stated that the original code will be "expanded" it sounds
as if it we could do it ourselves manually and that would be effectively
the same code. An alternative to deleting `(using iname)` could be
commenting it out `//(using iname)`.1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
0 commit comments