File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 33// BSD-style license that can be found in the LICENSE file.
44
55import 'package:analyzer/dart/ast/ast.dart' ;
6+ import 'package:analyzer/dart/ast/token.dart' ;
67import 'package:analyzer/dart/ast/visitor.dart' ;
78
89import '../analyzer.dart' ;
@@ -104,6 +105,9 @@ class _Visitor extends SimpleAstVisitor<void> {
104105 // Code like `(String).noSuchMethod()` is allowed.
105106 return ;
106107 }
108+ } else if (parent is PostfixExpression &&
109+ parent.operator .type == TokenType .BANG ) {
110+ return ;
107111 }
108112 rule.reportLint (node);
109113 return ;
Original file line number Diff line number Diff line change @@ -120,6 +120,11 @@ main() async {
120120 (a? .abs ()).hashCode;
121121 (a? ..abs ()).hashCode;
122122 (a? [0 ]).hashCode;
123+
124+ (a? .sign)! ;
125+ (a? .abs ())! ;
126+ (a? ..abs ())! ;
127+ (a? [0 ])! ;
123128}
124129
125130Invocation ? invocation () => null ;
You can’t perform that action at this time.
0 commit comments