Skip to content

Commit

Permalink
Adjust Initializing parameters to more precise initializing formal pa…
Browse files Browse the repository at this point in the history
…rameters

Fixes #4011
  • Loading branch information
parlough committed Apr 29, 2022
1 parent b490b5d commit 6d0c087
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/misc/lib/language_tour/classes/point_alt.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Point {
double y = 0;

Point(double x, double y) {
// See initializing parameters for a better way
// See initializing formal parameters for a better way
// to initialize instance variables.
this.x = x;
this.y = y;
Expand Down
6 changes: 3 additions & 3 deletions src/_guides/language/language-tour.md
Original file line number Diff line number Diff line change
Expand Up @@ -2850,7 +2850,7 @@ class Point {
double y = 0;
Point(double x, double y) {
// See initializing parameters for a better way
// See initializing formal parameters for a better way
// to initialize instance variables.
this.x = x;
this.y = y;
Expand All @@ -2866,11 +2866,11 @@ The `this` keyword refers to the current instance.
{{site.alert.end}}


#### Initializing parameters
#### Initializing formal parameters

The pattern of assigning a constructor argument to an instance variable
is so common,
Dart has initializing parameters to make it easy.
Dart has initializing formal parameters to make it easy.

Initializing parameters can also be used to initialize
non-nullable or `final` instance variables,
Expand Down

0 comments on commit 6d0c087

Please sign in to comment.