File tree Expand file tree Collapse file tree 3 files changed +52
-1
lines changed Expand file tree Collapse file tree 3 files changed +52
-1
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ class AstNodeVisitor extends ThrowingAstVisitor<Piece> with PieceFactory {
230
230
231
231
@override
232
232
Piece visitCastPattern (CastPattern node) {
233
- throw UnimplementedError ( );
233
+ return createInfix (node.pattern, node.asToken, node.type );
234
234
}
235
235
236
236
@override
Original file line number Diff line number Diff line change
1
+ 40 columns |
2
+ >>> Basic cast pattern.
3
+ if (object case x as int) {;}
4
+ <<<
5
+ if (object case x as int) {
6
+ ;
7
+ }
8
+ >>> Split before 'case'.
9
+ if (object case constant as VeryLongType) {;}
10
+ <<<
11
+ if (object
12
+ case constant as VeryLongType) {
13
+ ;
14
+ }
15
+ >>> Split before 'as'.
16
+ if (object case veryLongConstant as VeryLongType) {;}
17
+ <<<
18
+ if (object
19
+ case veryLongConstant
20
+ as VeryLongType) {
21
+ ;
22
+ }
Original file line number Diff line number Diff line change
1
+ 40 columns |
2
+ >>> Line comment before pattern.
3
+ if (obj case // c
4
+ constant as Type) {;}
5
+ <<<
6
+ if (obj
7
+ case // c
8
+ constant as Type) {
9
+ ;
10
+ }
11
+ >>> Line comment before 'as'.
12
+ if (obj case constant // c
13
+ as Type) {;}
14
+ <<<
15
+ if (obj
16
+ case constant // c
17
+ as Type) {
18
+ ;
19
+ }
20
+ >>> Line comment after 'as'.
21
+ if (obj case constant as // c
22
+ Type) {;}
23
+ <<<
24
+ if (obj
25
+ case constant
26
+ as // c
27
+ Type) {
28
+ ;
29
+ }
You can’t perform that action at this time.
0 commit comments