Skip to content

Commit

Permalink
fixes formatting failure, I hope
Browse files Browse the repository at this point in the history
  • Loading branch information
ericwindmill committed Jan 3, 2024
1 parent d229d25 commit 5bff97c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
6 changes: 3 additions & 3 deletions examples/misc/analyzer-results-stable.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Analyzing misc...

error - lib/language_tour/classes/point_this.dart:8:15 - Invalid reference to 'this' expression. - invalid_reference_to_this
info - lib/language_tour/classes/point_this.dart:8:15 - Unnecessary 'this.' qualifier. Try removing 'this.'. - unnecessary_this
info - lib/language_tour/classes/point_this.dart:9:20 - Unnecessary 'this.' qualifier. Try removing 'this.'. - unnecessary_this
error - lib/language_tour/classes/point_this.dart:7:15 - Invalid reference to 'this' expression. - invalid_reference_to_this
info - lib/language_tour/classes/point_this.dart:7:15 - Unnecessary 'this.' qualifier. Try removing 'this.'. - unnecessary_this
info - lib/language_tour/classes/point_this.dart:8:20 - Unnecessary 'this.' qualifier. Try removing 'this.'. - unnecessary_this

3 issues found.
6 changes: 2 additions & 4 deletions examples/misc/lib/language_tour/classes/point_this.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
double initialX = 1.5;

class Point {
double? x =
initialX; // OK, can access declarations that do not depend on `this`.
double? x = initialX; // OK, can access declarations that do not depend on `this`.
double? y = this.x; // ERROR, can't access `this` in non-`late` initializer.
late double? z = this.x; // OK, can access `this` in `late` initializer.

Point(this.x,
this.y); // OK, `this.fieldName` is a parameter declaration, not an expression.
Point(this.x, this.y); // OK, `this.fieldName` is a parameter declaration, not an expression.
}
// #enddocregion this-late
6 changes: 2 additions & 4 deletions src/language/classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,11 @@ of a non-`late` instance variable can't access `this`.
double initialX = 1.5;
class Point {
double? x =
initialX; // OK, can access declarations that do not depend on `this`.
double? x = initialX; // OK, can access declarations that do not depend on `this`.
double? y = this.x; // ERROR, can't access `this` in non-`late` initializer.
late double? z = this.x; // OK, can access `this` in `late` initializer.
Point(this.x,
this.y); // OK, `this.fieldName` is a parameter declaration, not an expression.
Point(this.x, this.y); // OK, `this.fieldName` is a parameter declaration, not an expression.
}
```

Expand Down

0 comments on commit 5bff97c

Please sign in to comment.