From a6d06ad852cfdbdb44969a1449d263c8f309a485 Mon Sep 17 00:00:00 2001 From: Dmitrii Naumenko Date: Wed, 14 Dec 2022 09:42:19 +0100 Subject: [PATCH] trait-parameters.md: delete invalid code from example This code doesn't compile and produces error: >[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)`. --- docs/_docs/reference/other-new-features/trait-parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/reference/other-new-features/trait-parameters.md b/docs/_docs/reference/other-new-features/trait-parameters.md index c704e73ce9b8..e46ba455c7b3 100644 --- a/docs/_docs/reference/other-new-features/trait-parameters.md +++ b/docs/_docs/reference/other-new-features/trait-parameters.md @@ -79,7 +79,7 @@ The definition of `F` in the last line is implicitly expanded to class F(using iname: ImpliedName) extends Object, ImpliedGreeting(using iname), - ImpliedFormalGreeting(using iname) + ImpliedFormalGreeting ``` Note the inserted reference to the super trait `ImpliedGreeting`, which was not mentioned explicitly.