Skip to content

Commit ddbc158

Browse files
committed
An initializing constructor parameter is in scope in the init list, not body.
Fix #4470.
1 parent 7d9adfb commit ddbc158

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

working/2509-private-named-parameters/feature-specification.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ However, initializing formals (the `this.` before a constructor parameter)
108108
complicate that story. When a named parameter is also an initializing formal,
109109
then the name affects *three* places in the program:
110110

111-
1. The name of the parameter variable inside the body of the constructor.
111+
1. The name of the parameter variable inside the constructor initializer list.
112+
(Inside the constructor *body*, it's the instance field that is in scope.)
112113

113114
2. The name used to pass an argument at the callsite.
114115

0 commit comments

Comments
 (0)