| OLD | NEW | 
|---|
| 1 // Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file | 
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a | 
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. | 
| 4 | 4 | 
| 5 part of dart2js.semantics_visitor_test; | 5 part of dart2js.semantics_visitor_test; | 
| 6 | 6 | 
| 7 const Map<String, List<Test>> DECL_TESTS = const { | 7 const Map<String, List<Test>> DECL_TESTS = const { | 
| 8   'Function declarations': const [ | 8   'Function declarations': const [ | 
| 9     const Test( | 9     const Test( | 
| 10         ''' | 10         ''' | 
| 11         m(a, b) {} | 11         m(a, b) {} | 
| 12         ''', | 12         ''', | 
| 13         const [ | 13         const [ | 
| 14           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 14           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 
| 15               element: 'function(m)', | 15               element: 'function(m)', parameters: '(a,b)', body: '{}'), | 
| 16               parameters: '(a,b)', |  | 
| 17               body: '{}'), |  | 
| 18           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 16           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 19               element: 'parameter(m#a)', | 17               element: 'parameter(m#a)', index: 0), | 
| 20               index: 0), |  | 
| 21           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 18           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 22               element: 'parameter(m#b)', | 19               element: 'parameter(m#b)', index: 1), | 
| 23               index: 1), |  | 
| 24         ]), | 20         ]), | 
| 25     const Test( | 21     const Test( | 
| 26         ''' | 22         ''' | 
| 27         m(a, [b]) {} | 23         m(a, [b]) {} | 
| 28         ''', | 24         ''', | 
| 29         const [ | 25         const [ | 
| 30           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 26           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 
| 31               element: 'function(m)', | 27               element: 'function(m)', parameters: '(a,[b])', body: '{}'), | 
| 32               parameters: '(a,[b])', |  | 
| 33               body: '{}'), |  | 
| 34           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 28           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 35               element: 'parameter(m#a)', | 29               element: 'parameter(m#a)', index: 0), | 
| 36               index: 0), |  | 
| 37           const Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL, | 30           const Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL, | 
| 38               element: 'parameter(m#b)', | 31               element: 'parameter(m#b)', index: 1, constant: 'null'), | 
| 39               index: 1, |  | 
| 40               constant: 'null'), |  | 
| 41         ]), | 32         ]), | 
| 42     const Test( | 33     const Test( | 
| 43         ''' | 34         ''' | 
| 44         m(a, [b = null]) {} | 35         m(a, [b = null]) {} | 
| 45         ''', | 36         ''', | 
| 46         const [ | 37         const [ | 
| 47           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 38           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 
| 48               element: 'function(m)', | 39               element: 'function(m)', parameters: '(a,[b=null])', body: '{}'), | 
| 49               parameters: '(a,[b=null])', |  | 
| 50               body: '{}'), |  | 
| 51           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 40           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 52               element: 'parameter(m#a)', | 41               element: 'parameter(m#a)', index: 0), | 
| 53               index: 0), |  | 
| 54           const Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL, | 42           const Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL, | 
| 55               element: 'parameter(m#b)', | 43               element: 'parameter(m#b)', constant: 'null', index: 1), | 
| 56               constant: 'null', |  | 
| 57               index: 1), |  | 
| 58         ]), | 44         ]), | 
| 59     const Test( | 45     const Test( | 
| 60         ''' | 46         ''' | 
| 61         m(a, [b = 42]) {} | 47         m(a, [b = 42]) {} | 
| 62         ''', | 48         ''', | 
| 63         const [ | 49         const [ | 
| 64           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 50           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 
| 65               element: 'function(m)', | 51               element: 'function(m)', parameters: '(a,[b=42])', body: '{}'), | 
| 66               parameters: '(a,[b=42])', |  | 
| 67               body: '{}'), |  | 
| 68           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 52           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 69               element: 'parameter(m#a)', | 53               element: 'parameter(m#a)', index: 0), | 
| 70               index: 0), |  | 
| 71           const Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL, | 54           const Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL, | 
| 72               element: 'parameter(m#b)', | 55               element: 'parameter(m#b)', constant: 42, index: 1), | 
| 73               constant: 42, |  | 
| 74               index: 1), |  | 
| 75         ]), | 56         ]), | 
| 76     const Test( | 57     const Test( | 
| 77         ''' | 58         ''' | 
| 78         m(a, {b}) {} | 59         m(a, {b}) {} | 
| 79         ''', | 60         ''', | 
| 80         const [ | 61         const [ | 
| 81           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 62           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 
| 82               element: 'function(m)', | 63               element: 'function(m)', parameters: '(a,{b})', body: '{}'), | 
| 83               parameters: '(a,{b})', |  | 
| 84               body: '{}'), |  | 
| 85           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 64           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 86               element: 'parameter(m#a)', | 65               element: 'parameter(m#a)', index: 0), | 
| 87               index: 0), |  | 
| 88           const Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL, | 66           const Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL, | 
| 89               element: 'parameter(m#b)', | 67               element: 'parameter(m#b)', constant: 'null'), | 
| 90               constant: 'null'), |  | 
| 91         ]), | 68         ]), | 
| 92     const Test( | 69     const Test( | 
| 93         ''' | 70         ''' | 
| 94         m(a, {b: null}) {} | 71         m(a, {b: null}) {} | 
| 95         ''', | 72         ''', | 
| 96         const [ | 73         const [ | 
| 97           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 74           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 
| 98               element: 'function(m)', | 75               element: 'function(m)', parameters: '(a,{b: null})', body: '{}'), | 
| 99               parameters: '(a,{b: null})', |  | 
| 100               body: '{}'), |  | 
| 101           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 76           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 102               element: 'parameter(m#a)', | 77               element: 'parameter(m#a)', index: 0), | 
| 103               index: 0), |  | 
| 104           const Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL, | 78           const Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL, | 
| 105               element: 'parameter(m#b)', | 79               element: 'parameter(m#b)', constant: 'null'), | 
| 106               constant: 'null'), |  | 
| 107         ]), | 80         ]), | 
| 108     const Test( | 81     const Test( | 
| 109         ''' | 82         ''' | 
| 110         m(a, {b:42}) {} | 83         m(a, {b:42}) {} | 
| 111         ''', | 84         ''', | 
| 112         const [ | 85         const [ | 
| 113           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 86           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 
| 114               element: 'function(m)', | 87               element: 'function(m)', parameters: '(a,{b: 42})', body: '{}'), | 
| 115               parameters: '(a,{b: 42})', |  | 
| 116               body: '{}'), |  | 
| 117           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 88           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 118               element: 'parameter(m#a)', | 89               element: 'parameter(m#a)', index: 0), | 
| 119               index: 0), |  | 
| 120           const Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL, | 90           const Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL, | 
| 121               element: 'parameter(m#b)', | 91               element: 'parameter(m#b)', constant: 42), | 
| 122               constant: 42), |  | 
| 123         ]), | 92         ]), | 
| 124     const Test( | 93     const Test( | 
| 125         ''' | 94         ''' | 
| 126         get m => null; | 95         get m => null; | 
| 127         ''', | 96         ''', | 
| 128         const [ | 97         const [ | 
| 129           const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_DECL, | 98           const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_DECL, | 
| 130               element: 'getter(m)', | 99               element: 'getter(m)', body: '=>null;'), | 
| 131               body: '=>null;'), |  | 
| 132         ]), | 100         ]), | 
| 133     const Test( | 101     const Test( | 
| 134         ''' | 102         ''' | 
| 135         set m(a) {} | 103         set m(a) {} | 
| 136         ''', | 104         ''', | 
| 137         const [ | 105         const [ | 
| 138           const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_DECL, | 106           const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_DECL, | 
| 139               element: 'setter(m)', | 107               element: 'setter(m)', parameters: '(a)', body: '{}'), | 
| 140               parameters: '(a)', |  | 
| 141               body: '{}'), |  | 
| 142           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 108           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 143               element: 'parameter(m#a)', | 109               element: 'parameter(m#a)', index: 0), | 
| 144               index: 0), |  | 
| 145         ]), | 110         ]), | 
| 146     const Test.clazz( | 111     const Test.clazz( | 
| 147         ''' | 112         ''' | 
| 148         class C { | 113         class C { | 
| 149           static m(a, b) {} | 114           static m(a, b) {} | 
| 150         } | 115         } | 
| 151         ''', | 116         ''', | 
| 152         const [ | 117         const [ | 
| 153           const Visit(VisitKind.VISIT_STATIC_FUNCTION_DECL, | 118           const Visit(VisitKind.VISIT_STATIC_FUNCTION_DECL, | 
| 154               element: 'function(C#m)', | 119               element: 'function(C#m)', parameters: '(a,b)', body: '{}'), | 
| 155               parameters: '(a,b)', |  | 
| 156               body: '{}'), |  | 
| 157           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 120           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 158               element: 'parameter(m#a)', | 121               element: 'parameter(m#a)', index: 0), | 
| 159               index: 0), |  | 
| 160           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 122           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 161               element: 'parameter(m#b)', | 123               element: 'parameter(m#b)', index: 1), | 
| 162               index: 1), |  | 
| 163         ]), | 124         ]), | 
| 164     const Test.clazz( | 125     const Test.clazz( | 
| 165         ''' | 126         ''' | 
| 166         class C { | 127         class C { | 
| 167           static get m => null; | 128           static get m => null; | 
| 168         } | 129         } | 
| 169         ''', | 130         ''', | 
| 170         const [ | 131         const [ | 
| 171           const Visit(VisitKind.VISIT_STATIC_GETTER_DECL, | 132           const Visit(VisitKind.VISIT_STATIC_GETTER_DECL, | 
| 172               element: 'getter(C#m)', | 133               element: 'getter(C#m)', body: '=>null;'), | 
| 173               body: '=>null;'), |  | 
| 174         ]), | 134         ]), | 
| 175     const Test.clazz( | 135     const Test.clazz( | 
| 176         ''' | 136         ''' | 
| 177         class C { | 137         class C { | 
| 178           static set m(a) {} | 138           static set m(a) {} | 
| 179         } | 139         } | 
| 180         ''', | 140         ''', | 
| 181         const [ | 141         const [ | 
| 182           const Visit(VisitKind.VISIT_STATIC_SETTER_DECL, | 142           const Visit(VisitKind.VISIT_STATIC_SETTER_DECL, | 
| 183               element: 'setter(C#m)', | 143               element: 'setter(C#m)', parameters: '(a)', body: '{}'), | 
| 184               parameters: '(a)', |  | 
| 185               body: '{}'), |  | 
| 186           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 144           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 187               element: 'parameter(m#a)', | 145               element: 'parameter(m#a)', index: 0), | 
| 188               index: 0), |  | 
| 189         ]), | 146         ]), | 
| 190     const Test.clazz( | 147     const Test.clazz( | 
| 191         ''' | 148         ''' | 
| 192         class C { | 149         class C { | 
| 193           m(a, b) {} | 150           m(a, b) {} | 
| 194         } | 151         } | 
| 195         ''', | 152         ''', | 
| 196         const [ | 153         const [ | 
| 197           const Visit(VisitKind.VISIT_INSTANCE_METHOD_DECL, | 154           const Visit(VisitKind.VISIT_INSTANCE_METHOD_DECL, | 
| 198               element: 'function(C#m)', | 155               element: 'function(C#m)', parameters: '(a,b)', body: '{}'), | 
| 199               parameters: '(a,b)', |  | 
| 200               body: '{}'), |  | 
| 201           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 156           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 202               element: 'parameter(m#a)', | 157               element: 'parameter(m#a)', index: 0), | 
| 203               index: 0), |  | 
| 204           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 158           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 205               element: 'parameter(m#b)', | 159               element: 'parameter(m#b)', index: 1), | 
| 206               index: 1), |  | 
| 207         ]), | 160         ]), | 
| 208     const Test.clazz( | 161     const Test.clazz( | 
| 209         ''' | 162         ''' | 
| 210         class C { | 163         class C { | 
| 211           get m => null; | 164           get m => null; | 
| 212         } | 165         } | 
| 213         ''', | 166         ''', | 
| 214         const [ | 167         const [ | 
| 215           const Visit(VisitKind.VISIT_INSTANCE_GETTER_DECL, | 168           const Visit(VisitKind.VISIT_INSTANCE_GETTER_DECL, | 
| 216               element: 'getter(C#m)', | 169               element: 'getter(C#m)', body: '=>null;'), | 
| 217               body: '=>null;'), |  | 
| 218         ]), | 170         ]), | 
| 219     const Test.clazz( | 171     const Test.clazz( | 
| 220         ''' | 172         ''' | 
| 221         class C { | 173         class C { | 
| 222           set m(a) {} | 174           set m(a) {} | 
| 223         } | 175         } | 
| 224         ''', | 176         ''', | 
| 225         const [ | 177         const [ | 
| 226           const Visit(VisitKind.VISIT_INSTANCE_SETTER_DECL, | 178           const Visit(VisitKind.VISIT_INSTANCE_SETTER_DECL, | 
| 227               element: 'setter(C#m)', | 179               element: 'setter(C#m)', parameters: '(a)', body: '{}'), | 
| 228               parameters: '(a)', |  | 
| 229               body: '{}'), |  | 
| 230           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 180           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 231               element: 'parameter(m#a)', | 181               element: 'parameter(m#a)', index: 0), | 
| 232               index: 0), |  | 
| 233         ]), | 182         ]), | 
| 234     const Test.clazz( | 183     const Test.clazz( | 
| 235         ''' | 184         ''' | 
| 236         abstract class C { | 185         abstract class C { | 
| 237           m(a, b); | 186           m(a, b); | 
| 238         } | 187         } | 
| 239         ''', | 188         ''', | 
| 240         const [ | 189         const [ | 
| 241           const Visit(VisitKind.VISIT_ABSTRACT_METHOD_DECL, | 190           const Visit(VisitKind.VISIT_ABSTRACT_METHOD_DECL, | 
| 242               element: 'function(C#m)', | 191               element: 'function(C#m)', parameters: '(a,b)'), | 
| 243               parameters: '(a,b)'), |  | 
| 244           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 192           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 245               element: 'parameter(m#a)', | 193               element: 'parameter(m#a)', index: 0), | 
| 246               index: 0), |  | 
| 247           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 194           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 248               element: 'parameter(m#b)', | 195               element: 'parameter(m#b)', index: 1), | 
| 249               index: 1), |  | 
| 250         ]), | 196         ]), | 
| 251     const Test.clazz( | 197     const Test.clazz( | 
| 252         ''' | 198         ''' | 
| 253         abstract class C { | 199         abstract class C { | 
| 254           get m; | 200           get m; | 
| 255         } | 201         } | 
| 256         ''', | 202         ''', | 
| 257         const [ | 203         const [ | 
| 258           const Visit(VisitKind.VISIT_ABSTRACT_GETTER_DECL, | 204           const Visit(VisitKind.VISIT_ABSTRACT_GETTER_DECL, | 
| 259               element: 'getter(C#m)'), | 205               element: 'getter(C#m)'), | 
| 260         ]), | 206         ]), | 
| 261     const Test.clazz( | 207     const Test.clazz( | 
| 262         ''' | 208         ''' | 
| 263         abstract class C { | 209         abstract class C { | 
| 264           set m(a); | 210           set m(a); | 
| 265         } | 211         } | 
| 266         ''', | 212         ''', | 
| 267         const [ | 213         const [ | 
| 268           const Visit(VisitKind.VISIT_ABSTRACT_SETTER_DECL, | 214           const Visit(VisitKind.VISIT_ABSTRACT_SETTER_DECL, | 
| 269               element: 'setter(C#m)', | 215               element: 'setter(C#m)', parameters: '(a)'), | 
| 270               parameters: '(a)'), |  | 
| 271           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 216           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 272               element: 'parameter(m#a)', | 217               element: 'parameter(m#a)', index: 0), | 
| 273               index: 0), |  | 
| 274         ]), | 218         ]), | 
| 275     const Test( | 219     const Test( | 
| 276         ''' | 220         ''' | 
| 277         m(a, b) {} | 221         m(a, b) {} | 
| 278         ''', | 222         ''', | 
| 279         const [ | 223         const [ | 
| 280           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 224           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 
| 281               element: 'function(m)', | 225               element: 'function(m)', parameters: '(a,b)', body: '{}'), | 
| 282               parameters: '(a,b)', |  | 
| 283               body: '{}'), |  | 
| 284           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 226           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 285               element: 'parameter(m#a)', | 227               element: 'parameter(m#a)', index: 0), | 
| 286               index: 0), |  | 
| 287           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 228           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 288               element: 'parameter(m#b)', | 229               element: 'parameter(m#b)', index: 1), | 
| 289               index: 1), |  | 
| 290         ]), | 230         ]), | 
| 291     const Test( | 231     const Test( | 
| 292         ''' | 232         ''' | 
| 293         m() { | 233         m() { | 
| 294           local(a, b) {} | 234           local(a, b) {} | 
| 295         } | 235         } | 
| 296         ''', | 236         ''', | 
| 297         const [ | 237         const [ | 
| 298           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 238           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 
| 299                element: 'function(m)', | 239               element: 'function(m)', parameters: '()', body: '{local(a,b){}}'), | 
| 300                parameters: '()', |  | 
| 301                body: '{local(a,b){}}'), |  | 
| 302           const Visit(VisitKind.VISIT_LOCAL_FUNCTION_DECL, | 240           const Visit(VisitKind.VISIT_LOCAL_FUNCTION_DECL, | 
| 303                element: 'function(m#local)', | 241               element: 'function(m#local)', parameters: '(a,b)', body: '{}'), | 
| 304                parameters: '(a,b)', |  | 
| 305                body: '{}'), |  | 
| 306           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 242           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 307               element: 'parameter(local#a)', | 243               element: 'parameter(local#a)', index: 0), | 
| 308               index: 0), |  | 
| 309           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 244           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 310               element: 'parameter(local#b)', | 245               element: 'parameter(local#b)', index: 1), | 
| 311               index: 1), |  | 
| 312         ]), | 246         ]), | 
| 313     const Test( | 247     const Test( | 
| 314         ''' | 248         ''' | 
| 315         m() => (a, b) {}; | 249         m() => (a, b) {}; | 
| 316         ''', | 250         ''', | 
| 317         const [ | 251         const [ | 
| 318           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 252           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 
| 319                element: 'function(m)', | 253               element: 'function(m)', parameters: '()', body: '=>(a,b){};'), | 
| 320                parameters: '()', |  | 
| 321                body: '=>(a,b){};'), |  | 
| 322           const Visit(VisitKind.VISIT_CLOSURE_DECL, | 254           const Visit(VisitKind.VISIT_CLOSURE_DECL, | 
| 323                element: 'function(m#)', | 255               element: 'function(m#)', parameters: '(a,b)', body: '{}'), | 
| 324                parameters: '(a,b)', |  | 
| 325                body: '{}'), |  | 
| 326           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 256           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 327               element: 'parameter(#a)', | 257               element: 'parameter(#a)', index: 0), | 
| 328               index: 0), |  | 
| 329           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 258           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 330               element: 'parameter(#b)', | 259               element: 'parameter(#b)', index: 1), | 
| 331               index: 1), |  | 
| 332         ]), | 260         ]), | 
| 333   ], | 261   ], | 
| 334   'Constructor declarations': const [ | 262   'Constructor declarations': const [ | 
| 335     const Test.clazz( | 263     const Test.clazz( | 
| 336         ''' | 264         ''' | 
| 337         class C { | 265         class C { | 
| 338           C(a, b); | 266           C(a, b); | 
| 339         } | 267         } | 
| 340         ''', | 268         ''', | 
| 341         const [ | 269         const [ | 
| 342           const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL, | 270           const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL, | 
| 343               element: 'generative_constructor(C#)', | 271               element: 'generative_constructor(C#)', | 
| 344               parameters: '(a,b)', | 272               parameters: '(a,b)', | 
| 345               body: ';'), | 273               body: ';'), | 
| 346           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 274           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 347               element: 'parameter(#a)', | 275               element: 'parameter(#a)', index: 0), | 
| 348               index: 0), |  | 
| 349           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 276           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 350               element: 'parameter(#b)', | 277               element: 'parameter(#b)', index: 1), | 
| 351               index: 1), |  | 
| 352           const Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE, | 278           const Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE, | 
| 353               element: 'generative_constructor(Object#)', | 279               element: 'generative_constructor(Object#)', type: 'Object'), | 
| 354               type: 'Object'), |  | 
| 355         ], | 280         ], | 
| 356         method: ''), | 281         method: ''), | 
| 357     const Test.clazz( | 282     const Test.clazz( | 
| 358         ''' | 283         ''' | 
| 359         class C { | 284         class C { | 
| 360           var b; | 285           var b; | 
| 361           C(a, this.b); | 286           C(a, this.b); | 
| 362         } | 287         } | 
| 363         ''', | 288         ''', | 
| 364         const [ | 289         const [ | 
| 365           const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL, | 290           const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL, | 
| 366               element: 'generative_constructor(C#)', | 291               element: 'generative_constructor(C#)', | 
| 367               parameters: '(a,this.b)', | 292               parameters: '(a,this.b)', | 
| 368               body: ';'), | 293               body: ';'), | 
| 369           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 294           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 370               element: 'parameter(#a)', | 295               element: 'parameter(#a)', index: 0), | 
| 371               index: 0), |  | 
| 372           const Visit(VisitKind.VISIT_REQUIRED_INITIALIZING_FORMAL_DECL, | 296           const Visit(VisitKind.VISIT_REQUIRED_INITIALIZING_FORMAL_DECL, | 
| 373               element: 'initializing_formal(#b)', | 297               element: 'initializing_formal(#b)', index: 1), | 
| 374               index: 1), |  | 
| 375           const Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE, | 298           const Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE, | 
| 376               element: 'generative_constructor(Object#)', | 299               element: 'generative_constructor(Object#)', type: 'Object'), | 
| 377               type: 'Object'), |  | 
| 378         ], | 300         ], | 
| 379         method: ''), | 301         method: ''), | 
| 380     const Test.clazz( | 302     const Test.clazz( | 
| 381         ''' | 303         ''' | 
| 382         class C { | 304         class C { | 
| 383           var b; | 305           var b; | 
| 384           C(a, [this.b = 42]); | 306           C(a, [this.b = 42]); | 
| 385         } | 307         } | 
| 386         ''', | 308         ''', | 
| 387         const [ | 309         const [ | 
| 388           const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL, | 310           const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL, | 
| 389               element: 'generative_constructor(C#)', | 311               element: 'generative_constructor(C#)', | 
| 390               parameters: '(a,[this.b=42])', | 312               parameters: '(a,[this.b=42])', | 
| 391               body: ';'), | 313               body: ';'), | 
| 392           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 314           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 393               element: 'parameter(#a)', | 315               element: 'parameter(#a)', index: 0), | 
| 394               index: 0), |  | 
| 395           const Visit(VisitKind.VISIT_OPTIONAL_INITIALIZING_FORMAL_DECL, | 316           const Visit(VisitKind.VISIT_OPTIONAL_INITIALIZING_FORMAL_DECL, | 
| 396               element: 'initializing_formal(#b)', | 317               element: 'initializing_formal(#b)', constant: 42, index: 1), | 
| 397               constant: 42, |  | 
| 398               index: 1), |  | 
| 399           const Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE, | 318           const Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE, | 
| 400               element: 'generative_constructor(Object#)', | 319               element: 'generative_constructor(Object#)', type: 'Object'), | 
| 401               type: 'Object'), |  | 
| 402         ], | 320         ], | 
| 403         method: ''), | 321         method: ''), | 
| 404     const Test.clazz( | 322     const Test.clazz( | 
| 405         ''' | 323         ''' | 
| 406         class C { | 324         class C { | 
| 407           var b; | 325           var b; | 
| 408           C(a, {this.b: 42}); | 326           C(a, {this.b: 42}); | 
| 409         } | 327         } | 
| 410         ''', | 328         ''', | 
| 411         const [ | 329         const [ | 
| 412           const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL, | 330           const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL, | 
| 413               element: 'generative_constructor(C#)', | 331               element: 'generative_constructor(C#)', | 
| 414               parameters: '(a,{this.b: 42})', | 332               parameters: '(a,{this.b: 42})', | 
| 415               body: ';'), | 333               body: ';'), | 
| 416           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 334           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 417               element: 'parameter(#a)', | 335               element: 'parameter(#a)', index: 0), | 
| 418               index: 0), |  | 
| 419           const Visit(VisitKind.VISIT_NAMED_INITIALIZING_FORMAL_DECL, | 336           const Visit(VisitKind.VISIT_NAMED_INITIALIZING_FORMAL_DECL, | 
| 420               element: 'initializing_formal(#b)', | 337               element: 'initializing_formal(#b)', constant: 42), | 
| 421               constant: 42), |  | 
| 422           const Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE, | 338           const Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE, | 
| 423               element: 'generative_constructor(Object#)', | 339               element: 'generative_constructor(Object#)', type: 'Object'), | 
| 424               type: 'Object'), |  | 
| 425         ], | 340         ], | 
| 426         method: ''), | 341         method: ''), | 
| 427     const Test.clazz( | 342     const Test.clazz( | 
| 428         ''' | 343         ''' | 
| 429         class C { | 344         class C { | 
| 430           C(a, b) : super(); | 345           C(a, b) : super(); | 
| 431         } | 346         } | 
| 432         ''', | 347         ''', | 
| 433         const [ | 348         const [ | 
| 434           const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL, | 349           const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL, | 
| 435               element: 'generative_constructor(C#)', | 350               element: 'generative_constructor(C#)', | 
| 436               parameters: '(a,b)', | 351               parameters: '(a,b)', | 
| 437               body: ';'), | 352               body: ';'), | 
| 438           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 353           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 439               element: 'parameter(#a)', | 354               element: 'parameter(#a)', index: 0), | 
| 440               index: 0), |  | 
| 441           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 355           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 442               element: 'parameter(#b)', | 356               element: 'parameter(#b)', index: 1), | 
| 443               index: 1), |  | 
| 444           const Visit(VisitKind.VISIT_SUPER_CONSTRUCTOR_INVOKE, | 357           const Visit(VisitKind.VISIT_SUPER_CONSTRUCTOR_INVOKE, | 
| 445               element: 'generative_constructor(Object#)', | 358               element: 'generative_constructor(Object#)', | 
| 446               type: 'Object', | 359               type: 'Object', | 
| 447               arguments: '()', | 360               arguments: '()', | 
| 448               selector: 'CallStructure(arity=0)'), | 361               selector: 'CallStructure(arity=0)'), | 
| 449         ], | 362         ], | 
| 450         method: ''), | 363         method: ''), | 
| 451     const Test.clazz( | 364     const Test.clazz( | 
| 452         ''' | 365         ''' | 
| 453         class C { | 366         class C { | 
| 454           var field; | 367           var field; | 
| 455           C(a, b) : this.field = a; | 368           C(a, b) : this.field = a; | 
| 456         } | 369         } | 
| 457         ''', | 370         ''', | 
| 458         const [ | 371         const [ | 
| 459           const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL, | 372           const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL, | 
| 460               element: 'generative_constructor(C#)', | 373               element: 'generative_constructor(C#)', | 
| 461               parameters: '(a,b)', | 374               parameters: '(a,b)', | 
| 462               body: ';'), | 375               body: ';'), | 
| 463           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 376           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 464               element: 'parameter(#a)', | 377               element: 'parameter(#a)', index: 0), | 
| 465               index: 0), |  | 
| 466           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 378           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 467               element: 'parameter(#b)', | 379               element: 'parameter(#b)', index: 1), | 
| 468               index: 1), |  | 
| 469           const Visit(VisitKind.VISIT_FIELD_INITIALIZER, | 380           const Visit(VisitKind.VISIT_FIELD_INITIALIZER, | 
| 470               element: 'field(C#field)', | 381               element: 'field(C#field)', rhs: 'a'), | 
| 471               rhs: 'a'), |  | 
| 472           const Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE, | 382           const Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE, | 
| 473               element: 'generative_constructor(Object#)', | 383               element: 'generative_constructor(Object#)', type: 'Object'), | 
| 474               type: 'Object'), |  | 
| 475         ], | 384         ], | 
| 476         method: ''), | 385         method: ''), | 
| 477     const Test.clazz( | 386     const Test.clazz( | 
| 478         ''' | 387         ''' | 
| 479         class C { | 388         class C { | 
| 480           var field1; | 389           var field1; | 
| 481           var field2; | 390           var field2; | 
| 482           C(a, b) : this.field1 = a, this.field2 = b; | 391           C(a, b) : this.field1 = a, this.field2 = b; | 
| 483         } | 392         } | 
| 484         ''', | 393         ''', | 
| 485         const [ | 394         const [ | 
| 486           const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL, | 395           const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL, | 
| 487               element: 'generative_constructor(C#)', | 396               element: 'generative_constructor(C#)', | 
| 488               parameters: '(a,b)', | 397               parameters: '(a,b)', | 
| 489               body: ';'), | 398               body: ';'), | 
| 490           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 399           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 491               element: 'parameter(#a)', | 400               element: 'parameter(#a)', index: 0), | 
| 492               index: 0), |  | 
| 493           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 401           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 494               element: 'parameter(#b)', | 402               element: 'parameter(#b)', index: 1), | 
| 495               index: 1), |  | 
| 496           const Visit(VisitKind.VISIT_FIELD_INITIALIZER, | 403           const Visit(VisitKind.VISIT_FIELD_INITIALIZER, | 
| 497               element: 'field(C#field1)', | 404               element: 'field(C#field1)', rhs: 'a'), | 
| 498               rhs: 'a'), |  | 
| 499           const Visit(VisitKind.VISIT_FIELD_INITIALIZER, | 405           const Visit(VisitKind.VISIT_FIELD_INITIALIZER, | 
| 500               element: 'field(C#field2)', | 406               element: 'field(C#field2)', rhs: 'b'), | 
| 501               rhs: 'b'), |  | 
| 502           const Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE, | 407           const Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE, | 
| 503               element: 'generative_constructor(Object#)', | 408               element: 'generative_constructor(Object#)', type: 'Object'), | 
| 504               type: 'Object'), |  | 
| 505         ], | 409         ], | 
| 506         method: ''), | 410         method: ''), | 
| 507     const Test.clazz( | 411     const Test.clazz( | 
| 508         ''' | 412         ''' | 
| 509         class C { | 413         class C { | 
| 510           C(a, b) : this._(a, b); | 414           C(a, b) : this._(a, b); | 
| 511           C._(a, b); | 415           C._(a, b); | 
| 512         } | 416         } | 
| 513         ''', | 417         ''', | 
| 514         const [ | 418         const [ | 
| 515           const Visit(VisitKind.VISIT_REDIRECTING_GENERATIVE_CONSTRUCTOR_DECL, | 419           const Visit(VisitKind.VISIT_REDIRECTING_GENERATIVE_CONSTRUCTOR_DECL, | 
| 516               element: 'generative_constructor(C#)', | 420               element: 'generative_constructor(C#)', | 
| 517               parameters: '(a,b)', | 421               parameters: '(a,b)', | 
| 518               initializers: ':this._(a,b)'), | 422               initializers: ':this._(a,b)'), | 
| 519           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 423           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 520               element: 'parameter(#a)', | 424               element: 'parameter(#a)', index: 0), | 
| 521               index: 0), |  | 
| 522           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 425           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 523               element: 'parameter(#b)', | 426               element: 'parameter(#b)', index: 1), | 
| 524               index: 1), |  | 
| 525           const Visit(VisitKind.VISIT_THIS_CONSTRUCTOR_INVOKE, | 427           const Visit(VisitKind.VISIT_THIS_CONSTRUCTOR_INVOKE, | 
| 526               element: 'generative_constructor(C#_)', | 428               element: 'generative_constructor(C#_)', | 
| 527               arguments: '(a,b)', | 429               arguments: '(a,b)', | 
| 528               selector: 'CallStructure(arity=2)'), | 430               selector: 'CallStructure(arity=2)'), | 
| 529         ], | 431         ], | 
| 530         method: ''), | 432         method: ''), | 
| 531     const Test.clazz( | 433     const Test.clazz( | 
| 532         ''' | 434         ''' | 
| 533         class C { | 435         class C { | 
| 534           factory C(a, b) => null; | 436           factory C(a, b) => null; | 
| 535         } | 437         } | 
| 536         ''', | 438         ''', | 
| 537         const [ | 439         const [ | 
| 538           const Visit(VisitKind.VISIT_FACTORY_CONSTRUCTOR_DECL, | 440           const Visit(VisitKind.VISIT_FACTORY_CONSTRUCTOR_DECL, | 
| 539               element: 'factory_constructor(C#)', | 441               element: 'factory_constructor(C#)', | 
| 540               parameters: '(a,b)', | 442               parameters: '(a,b)', | 
| 541               body: '=>null;'), | 443               body: '=>null;'), | 
| 542           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 444           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 543               element: 'parameter(#a)', | 445               element: 'parameter(#a)', index: 0), | 
| 544               index: 0), |  | 
| 545           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 446           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 546               element: 'parameter(#b)', | 447               element: 'parameter(#b)', index: 1), | 
| 547               index: 1), |  | 
| 548         ], | 448         ], | 
| 549         method: ''), | 449         method: ''), | 
| 550     const Test.clazz( | 450     const Test.clazz( | 
| 551         ''' | 451         ''' | 
| 552         class C { | 452         class C { | 
| 553           factory C(a, b) = C._; | 453           factory C(a, b) = C._; | 
| 554           C._(a, b); | 454           C._(a, b); | 
| 555         } | 455         } | 
| 556         ''', | 456         ''', | 
| 557         const [ | 457         const [ | 
| 558           const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL, | 458           const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL, | 
| 559               element: 'factory_constructor(C#)', | 459               element: 'factory_constructor(C#)', | 
| 560               parameters: '(a,b)', | 460               parameters: '(a,b)', | 
| 561               target: 'generative_constructor(C#_)', | 461               target: 'generative_constructor(C#_)', | 
| 562               type: 'C'), | 462               type: 'C'), | 
| 563           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 463           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 564               element: 'parameter(#a)', | 464               element: 'parameter(#a)', index: 0), | 
| 565               index: 0), |  | 
| 566           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 465           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 567               element: 'parameter(#b)', | 466               element: 'parameter(#b)', index: 1), | 
| 568               index: 1), |  | 
| 569         ], | 467         ], | 
| 570         method: ''), | 468         method: ''), | 
| 571     const Test.clazz( | 469     const Test.clazz( | 
| 572         ''' | 470         ''' | 
| 573         class C { | 471         class C { | 
| 574           factory C(a, b) = D; | 472           factory C(a, b) = D; | 
| 575         } | 473         } | 
| 576         class D<T> { | 474         class D<T> { | 
| 577           D(a, b); | 475           D(a, b); | 
| 578         } | 476         } | 
| 579         ''', | 477         ''', | 
| 580         const [ | 478         const [ | 
| 581           const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL, | 479           const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL, | 
| 582               element: 'factory_constructor(C#)', | 480               element: 'factory_constructor(C#)', | 
| 583               parameters: '(a,b)', | 481               parameters: '(a,b)', | 
| 584               target: 'generative_constructor(D#)', | 482               target: 'generative_constructor(D#)', | 
| 585               type: 'D'), | 483               type: 'D'), | 
| 586           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 484           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 587               element: 'parameter(#a)', | 485               element: 'parameter(#a)', index: 0), | 
| 588               index: 0), |  | 
| 589           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 486           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 590               element: 'parameter(#b)', | 487               element: 'parameter(#b)', index: 1), | 
| 591               index: 1), |  | 
| 592         ], | 488         ], | 
| 593         method: ''), | 489         method: ''), | 
| 594     const Test.clazz( | 490     const Test.clazz( | 
| 595         ''' | 491         ''' | 
| 596         class C { | 492         class C { | 
| 597           factory C(a, b) = D<int>; | 493           factory C(a, b) = D<int>; | 
| 598         } | 494         } | 
| 599         class D<T> { | 495         class D<T> { | 
| 600           D(a, b); | 496           D(a, b); | 
| 601         } | 497         } | 
| 602         ''', | 498         ''', | 
| 603         const [ | 499         const [ | 
| 604           const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL, | 500           const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL, | 
| 605               element: 'factory_constructor(C#)', | 501               element: 'factory_constructor(C#)', | 
| 606               parameters: '(a,b)', | 502               parameters: '(a,b)', | 
| 607               target: 'generative_constructor(D#)', | 503               target: 'generative_constructor(D#)', | 
| 608               type: 'D<int>'), | 504               type: 'D<int>'), | 
| 609           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 505           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 610               element: 'parameter(#a)', | 506               element: 'parameter(#a)', index: 0), | 
| 611               index: 0), |  | 
| 612           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 507           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 613               element: 'parameter(#b)', | 508               element: 'parameter(#b)', index: 1), | 
| 614               index: 1), |  | 
| 615         ], | 509         ], | 
| 616         method: ''), | 510         method: ''), | 
| 617     const Test.clazz( | 511     const Test.clazz( | 
| 618         ''' | 512         ''' | 
| 619         class C { | 513         class C { | 
| 620           factory C(a, b) = D<int>; | 514           factory C(a, b) = D<int>; | 
| 621         } | 515         } | 
| 622         class D<T> { | 516         class D<T> { | 
| 623           factory D(a, b) = E<D<T>>; | 517           factory D(a, b) = E<D<T>>; | 
| 624         } | 518         } | 
| 625         class E<S> { | 519         class E<S> { | 
| 626           E(a, b); | 520           E(a, b); | 
| 627         } | 521         } | 
| 628         ''', | 522         ''', | 
| 629         const [ | 523         const [ | 
| 630           const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL, | 524           const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL, | 
| 631               element: 'factory_constructor(C#)', | 525               element: 'factory_constructor(C#)', | 
| 632               parameters: '(a,b)', | 526               parameters: '(a,b)', | 
| 633               target: 'factory_constructor(D#)', | 527               target: 'factory_constructor(D#)', | 
| 634               type: 'D<int>'), | 528               type: 'D<int>'), | 
| 635           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 529           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 636               element: 'parameter(#a)', | 530               element: 'parameter(#a)', index: 0), | 
| 637               index: 0), |  | 
| 638           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 531           const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 
| 639               element: 'parameter(#b)', | 532               element: 'parameter(#b)', index: 1), | 
| 640               index: 1), |  | 
| 641         ], | 533         ], | 
| 642         method: ''), | 534         method: ''), | 
| 643   ], | 535   ], | 
| 644   "Field declarations": const [ | 536   "Field declarations": const [ | 
| 645     const Test.clazz( | 537     const Test.clazz( | 
| 646         ''' | 538         ''' | 
| 647         class C { | 539         class C { | 
| 648           var m; | 540           var m; | 
| 649         } | 541         } | 
| 650         ''', | 542         ''', | 
| (...skipping 14 matching lines...) Expand all  Loading... | 
| 665               element: 'field(C#n)'), | 557               element: 'field(C#n)'), | 
| 666         ]), | 558         ]), | 
| 667     const Test.clazz( | 559     const Test.clazz( | 
| 668         ''' | 560         ''' | 
| 669         class C { | 561         class C { | 
| 670           var m = 42; | 562           var m = 42; | 
| 671         } | 563         } | 
| 672         ''', | 564         ''', | 
| 673         const [ | 565         const [ | 
| 674           const Visit(VisitKind.VISIT_INSTANCE_FIELD_DECL, | 566           const Visit(VisitKind.VISIT_INSTANCE_FIELD_DECL, | 
| 675               element: 'field(C#m)', | 567               element: 'field(C#m)', rhs: 42), | 
| 676               rhs: 42), |  | 
| 677         ]), | 568         ]), | 
| 678     const Test( | 569     const Test( | 
| 679         ''' | 570         ''' | 
| 680         m() { | 571         m() { | 
| 681           var local; | 572           var local; | 
| 682         } | 573         } | 
| 683         ''', | 574         ''', | 
| 684         const [ | 575         const [ | 
| 685           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 576           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 
| 686               element: 'function(m)', | 577               element: 'function(m)', parameters: '()', body: '{var local;}'), | 
| 687               parameters: '()', |  | 
| 688               body: '{var local;}'), |  | 
| 689           const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL, | 578           const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL, | 
| 690               element: 'variable(m#local)'), | 579               element: 'variable(m#local)'), | 
| 691         ]), | 580         ]), | 
| 692     const Test( | 581     const Test( | 
| 693         ''' | 582         ''' | 
| 694         m() { | 583         m() { | 
| 695           var local = 42; | 584           var local = 42; | 
| 696         } | 585         } | 
| 697         ''', | 586         ''', | 
| 698         const [ | 587         const [ | 
| 699           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 588           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 
| 700               element: 'function(m)', | 589               element: 'function(m)', | 
| 701               parameters: '()', | 590               parameters: '()', | 
| 702               body: '{var local=42;}'), | 591               body: '{var local=42;}'), | 
| 703           const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL, | 592           const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL, | 
| 704               element: 'variable(m#local)', | 593               element: 'variable(m#local)', rhs: 42), | 
| 705               rhs: 42), |  | 
| 706         ]), | 594         ]), | 
| 707     const Test( | 595     const Test( | 
| 708         ''' | 596         ''' | 
| 709         m() { | 597         m() { | 
| 710           const local = 42; | 598           const local = 42; | 
| 711         } | 599         } | 
| 712         ''', | 600         ''', | 
| 713         const [ | 601         const [ | 
| 714           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 602           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 
| 715               element: 'function(m)', | 603               element: 'function(m)', | 
| 716               parameters: '()', | 604               parameters: '()', | 
| 717               body: '{const local=42;}'), | 605               body: '{const local=42;}'), | 
| 718           const Visit(VisitKind.VISIT_LOCAL_CONSTANT_DECL, | 606           const Visit(VisitKind.VISIT_LOCAL_CONSTANT_DECL, | 
| 719               element: 'variable(m#local)', | 607               element: 'variable(m#local)', constant: 42), | 
| 720               constant: 42), |  | 
| 721         ]), | 608         ]), | 
| 722     const Test( | 609     const Test( | 
| 723         ''' | 610         ''' | 
| 724         m() { | 611         m() { | 
| 725           var local1, local2; | 612           var local1, local2; | 
| 726         } | 613         } | 
| 727         ''', | 614         ''', | 
| 728         const [ | 615         const [ | 
| 729           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 616           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 
| 730               element: 'function(m)', | 617               element: 'function(m)', | 
| 731               parameters: '()', | 618               parameters: '()', | 
| 732               body: '{var local1,local2;}'), | 619               body: '{var local1,local2;}'), | 
| 733           const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL, | 620           const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL, | 
| 734               element: 'variable(m#local1)'), | 621               element: 'variable(m#local1)'), | 
| 735           const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL, | 622           const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL, | 
| 736               element: 'variable(m#local2)'), | 623               element: 'variable(m#local2)'), | 
| 737         ]), | 624         ]), | 
| 738     const Test( | 625     const Test( | 
| 739         ''' | 626         ''' | 
| 740         m() { | 627         m() { | 
| 741           var local1 = 42, local2 = true; | 628           var local1 = 42, local2 = true; | 
| 742         } | 629         } | 
| 743         ''', | 630         ''', | 
| 744         const [ | 631         const [ | 
| 745           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 632           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 
| 746               element: 'function(m)', | 633               element: 'function(m)', | 
| 747               parameters: '()', | 634               parameters: '()', | 
| 748               body: '{var local1=42,local2=true;}'), | 635               body: '{var local1=42,local2=true;}'), | 
| 749           const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL, | 636           const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL, | 
| 750               element: 'variable(m#local1)', | 637               element: 'variable(m#local1)', rhs: 42), | 
| 751               rhs: 42), |  | 
| 752           const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL, | 638           const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL, | 
| 753               element: 'variable(m#local2)', | 639               element: 'variable(m#local2)', rhs: true), | 
| 754               rhs: true), |  | 
| 755         ]), | 640         ]), | 
| 756     const Test( | 641     const Test( | 
| 757         ''' | 642         ''' | 
| 758         m() { | 643         m() { | 
| 759           const local1 = 42, local2 = true; | 644           const local1 = 42, local2 = true; | 
| 760         } | 645         } | 
| 761         ''', | 646         ''', | 
| 762         const [ | 647         const [ | 
| 763           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 648           const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 
| 764               element: 'function(m)', | 649               element: 'function(m)', | 
| 765               parameters: '()', | 650               parameters: '()', | 
| 766               body: '{const local1=42,local2=true;}'), | 651               body: '{const local1=42,local2=true;}'), | 
| 767           const Visit(VisitKind.VISIT_LOCAL_CONSTANT_DECL, | 652           const Visit(VisitKind.VISIT_LOCAL_CONSTANT_DECL, | 
| 768               element: 'variable(m#local1)', | 653               element: 'variable(m#local1)', constant: 42), | 
| 769               constant: 42), |  | 
| 770           const Visit(VisitKind.VISIT_LOCAL_CONSTANT_DECL, | 654           const Visit(VisitKind.VISIT_LOCAL_CONSTANT_DECL, | 
| 771               element: 'variable(m#local2)', | 655               element: 'variable(m#local2)', constant: true), | 
| 772               constant: true), |  | 
| 773         ]), | 656         ]), | 
| 774     const Test.clazz( | 657     const Test.clazz( | 
| 775         ''' | 658         ''' | 
| 776         class C { | 659         class C { | 
| 777           static var m; | 660           static var m; | 
| 778         } | 661         } | 
| 779         ''', | 662         ''', | 
| 780         const [ | 663         const [ | 
| 781           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, | 664           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, element: 'field(C#m)'), | 
| 782                 element: 'field(C#m)'), |  | 
| 783         ]), | 665         ]), | 
| 784     const Test.clazz( | 666     const Test.clazz( | 
| 785         ''' | 667         ''' | 
| 786         class C { | 668         class C { | 
| 787           static var m, n; | 669           static var m, n; | 
| 788         } | 670         } | 
| 789         ''', | 671         ''', | 
| 790         const [ | 672         const [ | 
| 791           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, | 673           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, element: 'field(C#m)'), | 
| 792               element: 'field(C#m)'), | 674           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, element: 'field(C#n)'), | 
| 793           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, |  | 
| 794               element: 'field(C#n)'), |  | 
| 795         ]), | 675         ]), | 
| 796     const Test.clazz( | 676     const Test.clazz( | 
| 797         ''' | 677         ''' | 
| 798         class C { | 678         class C { | 
| 799           static var k, l, m, n; | 679           static var k, l, m, n; | 
| 800         } | 680         } | 
| 801         ''', | 681         ''', | 
| 802         const [ | 682         const [ | 
| 803           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, | 683           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, element: 'field(C#k)'), | 
| 804               element: 'field(C#k)'), | 684           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, element: 'field(C#l)'), | 
| 805           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, | 685           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, element: 'field(C#m)'), | 
| 806               element: 'field(C#l)'), | 686           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, element: 'field(C#n)'), | 
| 807           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, |  | 
| 808               element: 'field(C#m)'), |  | 
| 809           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, |  | 
| 810               element: 'field(C#n)'), |  | 
| 811         ]), | 687         ]), | 
| 812     const Test.clazz( | 688     const Test.clazz( | 
| 813         ''' | 689         ''' | 
| 814         class C { | 690         class C { | 
| 815           static var m = 42; | 691           static var m = 42; | 
| 816         } | 692         } | 
| 817         ''', | 693         ''', | 
| 818         const [ | 694         const [ | 
| 819           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, | 695           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, | 
| 820                 element: 'field(C#m)', | 696               element: 'field(C#m)', rhs: 42), | 
| 821                 rhs: 42), |  | 
| 822         ]), | 697         ]), | 
| 823     const Test.clazz( | 698     const Test.clazz( | 
| 824         ''' | 699         ''' | 
| 825         class C { | 700         class C { | 
| 826           static var m = 42, n = true; | 701           static var m = 42, n = true; | 
| 827         } | 702         } | 
| 828         ''', | 703         ''', | 
| 829         const [ | 704         const [ | 
| 830           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, | 705           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, | 
| 831                 element: 'field(C#m)', | 706               element: 'field(C#m)', rhs: 42), | 
| 832                 rhs: 42), |  | 
| 833           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, | 707           const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, | 
| 834               element: 'field(C#n)', | 708               element: 'field(C#n)', rhs: true), | 
| 835               rhs: true), |  | 
| 836         ]), | 709         ]), | 
| 837     const Test.clazz( | 710     const Test.clazz( | 
| 838         ''' | 711         ''' | 
| 839         class C { | 712         class C { | 
| 840           static const m = 42; | 713           static const m = 42; | 
| 841         } | 714         } | 
| 842         ''', | 715         ''', | 
| 843         const [ | 716         const [ | 
| 844           const Visit(VisitKind.VISIT_STATIC_CONSTANT_DECL, | 717           const Visit(VisitKind.VISIT_STATIC_CONSTANT_DECL, | 
| 845                 element: 'field(C#m)', | 718               element: 'field(C#m)', constant: 42), | 
| 846                 constant: 42), |  | 
| 847         ]), | 719         ]), | 
| 848     const Test( | 720     const Test( | 
| 849         ''' | 721         ''' | 
| 850         var m; | 722         var m; | 
| 851         ''', | 723         ''', | 
| 852         const [ | 724         const [ | 
| 853           const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL, | 725           const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL, | 
| 854                 element: 'field(m)'), | 726               element: 'field(m)'), | 
| 855         ]), | 727         ]), | 
| 856     const Test( | 728     const Test( | 
| 857         ''' | 729         ''' | 
| 858         var m, n; | 730         var m, n; | 
| 859         ''', | 731         ''', | 
| 860         const [ | 732         const [ | 
| 861           const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL, | 733           const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL, | 
| 862               element: 'field(m)'), | 734               element: 'field(m)'), | 
| 863           const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL, | 735           const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL, | 
| 864               element: 'field(n)'), | 736               element: 'field(n)'), | 
| 865         ]), | 737         ]), | 
| 866     const Test( | 738     const Test( | 
| 867         ''' | 739         ''' | 
| 868         var m = 42; | 740         var m = 42; | 
| 869         ''', | 741         ''', | 
| 870         const [ | 742         const [ | 
| 871           const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL, | 743           const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL, | 
| 872                 element: 'field(m)', | 744               element: 'field(m)', rhs: 42), | 
| 873                 rhs: 42), |  | 
| 874         ]), | 745         ]), | 
| 875     const Test( | 746     const Test( | 
| 876         ''' | 747         ''' | 
| 877         const m = 42; | 748         const m = 42; | 
| 878         ''', | 749         ''', | 
| 879         const [ | 750         const [ | 
| 880           const Visit(VisitKind.VISIT_TOP_LEVEL_CONSTANT_DECL, | 751           const Visit(VisitKind.VISIT_TOP_LEVEL_CONSTANT_DECL, | 
| 881                 element: 'field(m)', | 752               element: 'field(m)', constant: 42), | 
| 882                 constant: 42), |  | 
| 883         ]), | 753         ]), | 
| 884   ], | 754   ], | 
| 885 }; | 755 }; | 
| OLD | NEW | 
|---|