Line data Source code
1 : /* valasymbolresolver.vala
2 : *
3 : * Copyright (C) 2006-2010 Jürg Billeter
4 : * Copyright (C) 2006-2008 Raffaele Sandrini
5 : *
6 : * This library is free software; you can redistribute it and/or
7 : * modify it under the terms of the GNU Lesser General Public
8 : * License as published by the Free Software Foundation; either
9 : * version 2.1 of the License, or (at your option) any later version.
10 :
11 : * This library is distributed in the hope that it will be useful,
12 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 : * Lesser General Public License for more details.
15 :
16 : * You should have received a copy of the GNU Lesser General Public
17 : * License along with this library; if not, write to the Free Software
18 : * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 : *
20 : * Author:
21 : * Jürg Billeter <j@bitron.ch>
22 : * Raffaele Sandrini <raffaele@sandrini.ch>
23 : */
24 :
25 : using GLib;
26 :
27 : /**
28 : * Code visitor resolving symbol names.
29 : */
30 6152 : public class Vala.SymbolResolver : CodeVisitor {
31 1538 : Symbol root_symbol;
32 1538 : Scope current_scope;
33 :
34 : /**
35 : * Resolve symbol names in the specified code context.
36 : *
37 : * @param context a code context
38 : */
39 1429 : public void resolve (CodeContext context) {
40 16387045 : root_symbol = context.root;
41 :
42 1429 : context.root.accept (this);
43 :
44 1429 : root_symbol = null;
45 : }
46 :
47 122339 : public override void visit_namespace (Namespace ns) {
48 92206126 : var old_scope = current_scope;
49 123768 : current_scope = ns.scope;
50 :
51 61884 : ns.accept_children (this);
52 :
53 122339 : current_scope = old_scope;
54 : }
55 :
56 348763 : public override void visit_class (Class cl) {
57 348763 : if (cl.checked) {
58 : return;
59 : }
60 :
61 697526 : current_scope = cl.scope;
62 :
63 348763 : cl.accept_children (this);
64 :
65 348763 : cl.base_class = null;
66 981451 : foreach (DataType type in cl.get_base_types ()) {
67 316346 : if (type.type_symbol is Class) {
68 214260 : if (cl.base_class != null) {
69 1 : cl.error = true;
70 1 : Report.error (type.source_reference, "%s: Classes cannot have multiple base classes (`%s' and `%s')", cl.get_full_name (), cl.base_class.get_full_name (), type.type_symbol.get_full_name ());
71 1 : return;
72 : }
73 214259 : cl.base_class = (Class) type.type_symbol;
74 214259 : if (cl.base_class.is_subtype_of (cl)) {
75 1 : cl.error = true;
76 1 : Report.error (type.source_reference, "Base class cycle (`%s' and `%s')", cl.get_full_name (), cl.base_class.get_full_name ());
77 1 : return;
78 : }
79 : }
80 : }
81 :
82 697522 : current_scope = current_scope.parent_scope;
83 : }
84 :
85 133574 : public override void visit_struct (Struct st) {
86 133574 : if (st.checked) {
87 : return;
88 : }
89 :
90 267148 : current_scope = st.scope;
91 :
92 133574 : st.accept_children (this);
93 :
94 144072 : if (st.base_type != null) {
95 10500 : var base_type = st.base_struct;
96 10499 : if (base_type != null) {
97 10499 : if (base_type.is_subtype_of (st)) {
98 1 : st.error = true;
99 1 : Report.error (st.source_reference, "Base struct cycle (`%s' and `%s')", st.get_full_name (), base_type.get_full_name ());
100 1 : return;
101 : }
102 : }
103 : }
104 :
105 267146 : current_scope = current_scope.parent_scope;
106 : }
107 :
108 54470 : public override void visit_interface (Interface iface) {
109 54470 : if (iface.checked) {
110 : return;
111 : }
112 :
113 108940 : current_scope = iface.scope;
114 :
115 54470 : iface.accept_children (this);
116 :
117 191284 : foreach (DataType type in iface.get_prerequisites ()) {
118 68408 : if (type.type_symbol != null && type.type_symbol.is_subtype_of (iface)) {
119 1 : iface.error = true;
120 1 : Report.error (type.source_reference, "Prerequisite cycle (`%s' and `%s')", iface.get_full_name (), type.type_symbol.get_full_name ());
121 1 : return;
122 : }
123 : }
124 :
125 108938 : current_scope = current_scope.parent_scope;
126 : }
127 :
128 195188 : public override void visit_enum (Enum en) {
129 195188 : if (en.checked) {
130 : return;
131 : }
132 :
133 390376 : current_scope = en.scope;
134 :
135 195188 : en.accept_children (this);
136 :
137 390376 : current_scope = current_scope.parent_scope;
138 : }
139 :
140 28670 : public override void visit_error_domain (ErrorDomain ed) {
141 28670 : if (ed.checked) {
142 : return;
143 : }
144 :
145 57340 : current_scope = ed.scope;
146 :
147 28670 : ed.accept_children (this);
148 :
149 57340 : current_scope = current_scope.parent_scope;
150 : }
151 :
152 177811 : public override void visit_delegate (Delegate cb) {
153 177811 : if (cb.checked) {
154 : return;
155 : }
156 :
157 355622 : current_scope = cb.scope;
158 :
159 177811 : cb.accept_children (this);
160 :
161 355622 : current_scope = current_scope.parent_scope;
162 : }
163 :
164 1224200 : public override void visit_constant (Constant c) {
165 612100 : if (c.checked) {
166 : return;
167 : }
168 :
169 612100 : var old_scope = current_scope;
170 612100 : if (!(c.parent_symbol is Block)) {
171 : // non-local constant
172 1224154 : current_scope = c.scope;
173 : }
174 :
175 612100 : c.accept_children (this);
176 :
177 1224200 : current_scope = old_scope;
178 : }
179 :
180 542235 : public override void visit_field (Field f) {
181 542235 : if (f.checked) {
182 : return;
183 : }
184 :
185 1084470 : current_scope = f.scope;
186 :
187 542235 : f.accept_children (this);
188 :
189 1084470 : current_scope = current_scope.parent_scope;
190 : }
191 :
192 5568609 : public override void visit_method (Method m) {
193 5568609 : if (m.checked) {
194 : return;
195 : }
196 :
197 11137218 : current_scope = m.scope;
198 :
199 5568609 : m.accept_children (this);
200 :
201 11137218 : current_scope = current_scope.parent_scope;
202 : }
203 :
204 527449 : public override void visit_creation_method (CreationMethod m) {
205 527449 : if (m.checked) {
206 : return;
207 : }
208 527449 : m.accept_children (this);
209 : }
210 :
211 8376704 : public override void visit_formal_parameter (Parameter p) {
212 8376704 : if (p.checked) {
213 : return;
214 : }
215 8376704 : p.accept_children (this);
216 : }
217 :
218 419758 : public override void visit_property (Property prop) {
219 419758 : if (prop.checked) {
220 : return;
221 : }
222 419758 : prop.accept_children (this);
223 : }
224 :
225 707391 : public override void visit_property_accessor (PropertyAccessor acc) {
226 707391 : if (acc.checked) {
227 : return;
228 : }
229 707391 : acc.accept_children (this);
230 : }
231 :
232 127853 : public override void visit_signal (Signal sig) {
233 127853 : if (sig.checked) {
234 : return;
235 : }
236 127853 : sig.accept_children (this);
237 : }
238 :
239 35 : public override void visit_constructor (Constructor c) {
240 35 : if (c.checked) {
241 : return;
242 : }
243 35 : c.accept_children (this);
244 : }
245 :
246 17 : public override void visit_destructor (Destructor d) {
247 17 : if (d.checked) {
248 : return;
249 : }
250 17 : d.accept_children (this);
251 : }
252 :
253 276770 : public override void visit_block (Block b) {
254 276770 : if (b.checked) {
255 : return;
256 : }
257 276770 : b.accept_children (this);
258 : }
259 :
260 3571 : public override void visit_using_directive (UsingDirective ns) {
261 1786 : var unresolved_symbol = ns.namespace_symbol as UnresolvedSymbol;
262 1786 : if (unresolved_symbol != null) {
263 1786 : ns.namespace_symbol = resolve_symbol (unresolved_symbol);
264 1786 : if (!(ns.namespace_symbol is Namespace)) {
265 1 : ns.error = true;
266 1 : Report.error (ns.source_reference, "The namespace name `%s' could not be found", unresolved_symbol.to_string ());
267 1 : return;
268 : }
269 : }
270 : }
271 :
272 21272348 : private Symbol? resolve_symbol (UnresolvedSymbol unresolved_symbol) {
273 21272348 : if (unresolved_symbol.qualified) {
274 : // qualified access to global symbol
275 15 : return root_symbol.scope.lookup (unresolved_symbol.name);
276 21272333 : } else if (unresolved_symbol.inner == null) {
277 16374277 : Symbol sym = null;
278 16374277 : Scope scope = current_scope;
279 73828370 : while (sym == null && scope != null) {
280 57454093 : sym = scope.lookup (unresolved_symbol.name);
281 :
282 : // only look for types and type containers
283 57454093 : if (!(sym is Namespace || sym is TypeSymbol)) {
284 41082903 : sym = null;
285 : }
286 :
287 100725073 : scope = scope.parent_scope;
288 : }
289 : // Look for matches in inner types of base-types/prerequisites
290 16374277 : ObjectTypeSymbol? current_symbol = null;
291 16374277 : if (sym == null) {
292 6174 : scope = current_scope;
293 6714 : while (scope != null) {
294 5788 : if (scope.owner is ObjectTypeSymbol) {
295 2161 : current_symbol = (ObjectTypeSymbol) scope.owner;
296 2161 : break;
297 : }
298 6328 : scope = scope.parent_scope;
299 : }
300 : }
301 3087 : if (current_symbol != null) {
302 : unowned List<DataType> types;
303 2161 : if (current_symbol is Class) {
304 1986 : types = ((Class) current_symbol).get_base_types ();
305 175 : } else if (current_symbol is Interface) {
306 175 : types = ((Interface) current_symbol).get_prerequisites ();
307 : } else {
308 2161 : assert_not_reached ();
309 : }
310 7137 : foreach (DataType type in types) {
311 2739 : if (type.type_symbol == null) {
312 498 : continue;
313 : }
314 :
315 2241 : var local_sym = SemanticAnalyzer.symbol_lookup_inherited (type.type_symbol, unresolved_symbol.name);
316 :
317 : // only look for types and type containers
318 2241 : if (!(local_sym is Namespace || local_sym is TypeSymbol)) {
319 2231 : local_sym = null;
320 : }
321 :
322 2249 : if (local_sym != null && local_sym.access == SymbolAccessibility.PUBLIC) {
323 10 : if (sym != null && sym != local_sym) {
324 2 : unresolved_symbol.error = true;
325 2 : Report.error (unresolved_symbol.source_reference, "`%s' is an ambiguous reference between `%s' and `%s'", unresolved_symbol.name, sym.get_full_name (), local_sym.get_full_name ());
326 2 : return null;
327 : }
328 8 : sym = local_sym;
329 : }
330 : }
331 : }
332 16374275 : if (sym == null && unresolved_symbol.source_reference != null) {
333 15165 : foreach (UsingDirective ns in unresolved_symbol.source_reference.using_directives) {
334 6042 : if (ns.error || ns.namespace_symbol is UnresolvedSymbol) {
335 0 : continue;
336 : }
337 :
338 6042 : var local_sym = ns.namespace_symbol.scope.lookup (unresolved_symbol.name);
339 :
340 : // only look for types and type containers
341 6042 : if (!(local_sym is Namespace || local_sym is TypeSymbol)) {
342 2744 : local_sym = null;
343 : }
344 :
345 9340 : if (local_sym != null) {
346 3298 : if (sym != null && sym != local_sym) {
347 0 : unresolved_symbol.error = true;
348 0 : Report.error (unresolved_symbol.source_reference, "`%s' is an ambiguous reference between `%s' and `%s'", unresolved_symbol.name, sym.get_full_name (), local_sym.get_full_name ());
349 0 : return null;
350 : }
351 3298 : sym = local_sym;
352 : }
353 : }
354 : }
355 :
356 16374275 : return sym;
357 : } else {
358 4898056 : var parent_symbol = resolve_symbol (unresolved_symbol.inner);
359 4898056 : if (parent_symbol == null) {
360 0 : unresolved_symbol.error = true;
361 0 : Report.error (unresolved_symbol.inner.source_reference, "The symbol `%s' could not be found", unresolved_symbol.inner.name);
362 0 : return null;
363 : }
364 4898056 : parent_symbol.used = true;
365 :
366 4898056 : return parent_symbol.scope.lookup (unresolved_symbol.name);
367 : }
368 : }
369 :
370 757644 : bool has_base_struct_cycle (Struct st, Struct loop_st) {
371 757644 : if (!(st.base_type is UnresolvedType)) {
372 750160 : return false;
373 : }
374 :
375 7500 : var sym = resolve_symbol (((UnresolvedType) st.base_type).unresolved_symbol);
376 7500 : unowned Struct? base_struct = sym as Struct;
377 7500 : if (base_struct == null) {
378 16 : return false;
379 : }
380 :
381 7484 : if (base_struct == loop_st) {
382 1 : return true;
383 : }
384 :
385 7483 : return has_base_struct_cycle (base_struct, loop_st);
386 : }
387 :
388 6729250 : DataType get_type_for_struct (Struct st, Struct base_struct, SourceReference? source_reference) {
389 7479409 : if (st.base_type != null) {
390 : // make sure that base type is resolved
391 :
392 750161 : if (has_base_struct_cycle (st, st)) {
393 : // recursive declaration in base type
394 1 : return new StructValueType (st, source_reference);
395 : }
396 :
397 750160 : if (current_scope == st.scope) {
398 : // recursive declaration in generic base type
399 1 : return new StructValueType (st, source_reference);
400 : }
401 :
402 750159 : var old_scope = current_scope;
403 1500318 : current_scope = st.scope;
404 :
405 750159 : st.base_type.accept (this);
406 :
407 1500318 : current_scope = old_scope;
408 : }
409 :
410 6729248 : if (base_struct.base_struct != null) {
411 376148 : return get_type_for_struct (st, base_struct.base_struct, source_reference);
412 : }
413 :
414 : // attributes are not processed yet, access them directly
415 6353100 : if (base_struct.has_attribute ("BooleanType")) {
416 1581535 : return new BooleanType (st, source_reference);
417 4771565 : } else if (base_struct.has_attribute ("IntegerType")) {
418 3836818 : return new IntegerType (st, null, null, source_reference);
419 934747 : } else if (base_struct.has_attribute ("FloatingType")) {
420 626307 : return new FloatingType (st, source_reference);
421 : } else {
422 308440 : return new StructValueType (st, source_reference);
423 : }
424 : }
425 :
426 16367863 : private DataType resolve_type (UnresolvedType unresolved_type) {
427 16367863 : DataType type = null;
428 :
429 : // still required for vapigen
430 16367863 : if (unresolved_type.unresolved_symbol.name == "void") {
431 2857 : return new VoidType (unresolved_type.source_reference);
432 : }
433 :
434 16365006 : var sym = resolve_symbol (unresolved_type.unresolved_symbol);
435 16365006 : if (sym == null) {
436 : // don't report same error twice
437 2 : if (!unresolved_type.unresolved_symbol.error) {
438 0 : Report.error (unresolved_type.source_reference, "The type name `%s' could not be found", unresolved_type.unresolved_symbol.to_string ());
439 : }
440 2 : return new InvalidType ();
441 : }
442 :
443 16365004 : if (sym is TypeSymbol) {
444 16365004 : if (sym is Delegate) {
445 488497 : type = new DelegateType ((Delegate) sym, unresolved_type.source_reference);
446 15876507 : } else if (sym is Class) {
447 7096433 : unowned Class cl = (Class) sym;
448 7096433 : if (cl.is_error_base) {
449 589944 : type = new ErrorType (null, null, unresolved_type.source_reference);
450 : } else {
451 6506489 : type = new ObjectType (cl, unresolved_type.source_reference);
452 : }
453 8780074 : } else if (sym is Interface) {
454 431830 : type = new ObjectType ((Interface) sym, unresolved_type.source_reference);
455 8348244 : } else if (sym is Struct) {
456 6353102 : type = get_type_for_struct ((Struct) sym, (Struct) sym, unresolved_type.source_reference);
457 1995142 : } else if (sym is Enum) {
458 887723 : type = new EnumValueType ((Enum) sym, unresolved_type.source_reference);
459 1107419 : } else if (sym is ErrorDomain) {
460 318651 : type = new ErrorType ((ErrorDomain) sym, null, unresolved_type.source_reference);
461 788768 : } else if (sym is ErrorCode) {
462 11 : type = new ErrorType ((ErrorDomain) sym.parent_symbol, (ErrorCode) sym, unresolved_type.source_reference);
463 788757 : } else if (sym is TypeParameter) {
464 788757 : type = new GenericType ((TypeParameter) sym, unresolved_type.source_reference);
465 : } else {
466 0 : Report.error (unresolved_type.source_reference, "internal error: `%s' is not a supported type", sym.get_full_name ());
467 0 : return new InvalidType ();
468 : }
469 : } else {
470 0 : Report.error (unresolved_type.source_reference, "`%s' is not a type", sym.get_full_name ());
471 0 : return new InvalidType ();
472 : }
473 :
474 16365004 : type.source_reference = unresolved_type.source_reference;
475 16365004 : type.value_owned = unresolved_type.value_owned;
476 16365004 : type.nullable = unresolved_type.nullable;
477 16365004 : sym.used = true;
478 :
479 16365004 : type.is_dynamic = unresolved_type.is_dynamic;
480 17493318 : foreach (DataType type_arg in unresolved_type.get_type_arguments ()) {
481 564157 : type.add_type_argument (type_arg);
482 : }
483 :
484 16365004 : return type;
485 : }
486 :
487 36722138 : public override void visit_data_type (DataType data_type) {
488 20354275 : data_type.accept_children (this);
489 :
490 20354275 : if (!(data_type is UnresolvedType)) {
491 : return;
492 : }
493 :
494 16367863 : var unresolved_type = (UnresolvedType) data_type;
495 :
496 16367863 : unresolved_type.parent_node.replace_type (unresolved_type, resolve_type (unresolved_type));
497 : }
498 :
499 94360 : public override void visit_declaration_statement (DeclarationStatement stmt) {
500 94360 : if (stmt.checked) {
501 : return;
502 : }
503 94360 : stmt.accept_children (this);
504 : }
505 :
506 94364 : public override void visit_local_variable (LocalVariable local) {
507 94364 : if (local.checked) {
508 : return;
509 : }
510 94364 : local.accept_children (this);
511 : }
512 :
513 1051 : public override void visit_initializer_list (InitializerList list) {
514 1051 : if (list.checked) {
515 : return;
516 : }
517 1051 : list.accept_children (this);
518 : }
519 :
520 48 : public override void visit_with_statement (WithStatement stmt) {
521 48 : stmt.accept_children (this);
522 : }
523 :
524 199261 : public override void visit_expression_statement (ExpressionStatement stmt) {
525 199261 : if (stmt.checked) {
526 : return;
527 : }
528 199261 : stmt.accept_children (this);
529 : }
530 :
531 73157 : public override void visit_if_statement (IfStatement stmt) {
532 73157 : if (stmt.checked) {
533 : return;
534 : }
535 73157 : stmt.accept_children (this);
536 : }
537 :
538 109 : public override void visit_switch_statement (SwitchStatement stmt) {
539 109 : if (stmt.checked) {
540 : return;
541 : }
542 109 : stmt.accept_children (this);
543 : }
544 :
545 571 : public override void visit_switch_section (SwitchSection section) {
546 571 : if (section.checked) {
547 : return;
548 : }
549 571 : section.accept_children (this);
550 : }
551 :
552 664 : public override void visit_switch_label (SwitchLabel label) {
553 664 : if (label.checked) {
554 : return;
555 : }
556 664 : label.accept_children (this);
557 : }
558 :
559 0 : public override void visit_loop_statement (LoopStatement stmt) {
560 0 : if (stmt.checked) {
561 : return;
562 : }
563 0 : stmt.accept_children (this);
564 : }
565 :
566 8708 : public override void visit_while_statement (WhileStatement stmt) {
567 8708 : if (stmt.checked) {
568 : return;
569 : }
570 8708 : stmt.accept_children (this);
571 : }
572 :
573 9 : public override void visit_do_statement (DoStatement stmt) {
574 9 : if (stmt.checked) {
575 : return;
576 : }
577 9 : stmt.accept_children (this);
578 : }
579 :
580 4442 : public override void visit_for_statement (ForStatement stmt) {
581 4442 : if (stmt.checked) {
582 : return;
583 : }
584 4442 : stmt.accept_children (this);
585 : }
586 :
587 653 : public override void visit_foreach_statement (ForeachStatement stmt) {
588 653 : if (stmt.checked) {
589 : return;
590 : }
591 653 : stmt.accept_children (this);
592 : }
593 :
594 158589 : public override void visit_return_statement (ReturnStatement stmt) {
595 158589 : if (stmt.checked) {
596 : return;
597 : }
598 158589 : stmt.accept_children (this);
599 : }
600 :
601 18 : public override void visit_yield_statement (YieldStatement stmt) {
602 18 : if (stmt.checked) {
603 : return;
604 : }
605 18 : stmt.accept_children (this);
606 : }
607 :
608 1487 : public override void visit_throw_statement (ThrowStatement stmt) {
609 1487 : if (stmt.checked) {
610 : return;
611 : }
612 1487 : stmt.accept_children (this);
613 : }
614 :
615 2989 : public override void visit_try_statement (TryStatement stmt) {
616 2989 : if (stmt.checked) {
617 : return;
618 : }
619 2989 : stmt.accept_children (this);
620 : }
621 :
622 6 : public override void visit_delete_statement (DeleteStatement stmt) {
623 6 : stmt.accept_children (this);
624 : }
625 :
626 2986 : public override void visit_catch_clause (CatchClause clause) {
627 2986 : if (clause.checked) {
628 : return;
629 : }
630 2986 : clause.accept_children (this);
631 : }
632 :
633 7273 : public override void visit_array_creation_expression (ArrayCreationExpression e) {
634 7273 : if (e.checked) {
635 : return;
636 : }
637 7273 : e.accept_children (this);
638 : }
639 :
640 15 : public override void visit_template (Template tmpl) {
641 15 : if (tmpl.checked) {
642 : return;
643 : }
644 15 : tmpl.accept_children (this);
645 : }
646 :
647 2 : public override void visit_tuple (Tuple tuple) {
648 2 : if (tuple.checked) {
649 : return;
650 : }
651 2 : tuple.accept_children (this);
652 : }
653 :
654 1538859 : public override void visit_member_access (MemberAccess expr) {
655 1538859 : if (expr.checked) {
656 : return;
657 : }
658 1538859 : expr.accept_children (this);
659 : }
660 :
661 190726 : public override void visit_method_call (MethodCall expr) {
662 190726 : if (expr.checked) {
663 : return;
664 : }
665 190726 : expr.accept_children (this);
666 : }
667 :
668 22903 : public override void visit_element_access (ElementAccess expr) {
669 22903 : if (expr.checked) {
670 : return;
671 : }
672 22903 : expr.accept_children (this);
673 : }
674 :
675 38 : public override void visit_slice_expression (SliceExpression expr) {
676 38 : if (expr.checked) {
677 : return;
678 : }
679 38 : expr.accept_children (this);
680 : }
681 :
682 6168 : public override void visit_postfix_expression (PostfixExpression expr) {
683 6168 : if (expr.checked) {
684 : return;
685 : }
686 6168 : expr.accept_children (this);
687 : }
688 :
689 18342 : public override void visit_object_creation_expression (ObjectCreationExpression expr) {
690 18342 : if (expr.checked) {
691 : return;
692 : }
693 18342 : expr.accept_children (this);
694 : }
695 :
696 5705 : public override void visit_sizeof_expression (SizeofExpression expr) {
697 5705 : if (expr.checked) {
698 : return;
699 : }
700 5705 : expr.accept_children (this);
701 : }
702 :
703 152 : public override void visit_typeof_expression (TypeofExpression expr) {
704 152 : if (expr.checked) {
705 : return;
706 : }
707 152 : expr.accept_children (this);
708 : }
709 :
710 20246 : public override void visit_unary_expression (UnaryExpression expr) {
711 20246 : if (expr.checked) {
712 : return;
713 : }
714 20246 : expr.accept_children (this);
715 : }
716 :
717 177189 : public override void visit_cast_expression (CastExpression expr) {
718 177189 : if (expr.checked) {
719 : return;
720 : }
721 177189 : expr.accept_children (this);
722 : }
723 :
724 14 : public override void visit_named_argument (NamedArgument expr) {
725 14 : expr.accept_children (this);
726 : }
727 :
728 12805 : public override void visit_pointer_indirection (PointerIndirection expr) {
729 12805 : if (expr.checked) {
730 : return;
731 : }
732 12805 : expr.accept_children (this);
733 : }
734 :
735 2867 : public override void visit_addressof_expression (AddressofExpression expr) {
736 2867 : if (expr.checked) {
737 : return;
738 : }
739 2867 : expr.accept_children (this);
740 : }
741 :
742 14242 : public override void visit_reference_transfer_expression (ReferenceTransferExpression expr) {
743 14242 : if (expr.checked) {
744 : return;
745 : }
746 14242 : expr.accept_children (this);
747 : }
748 :
749 295826 : public override void visit_binary_expression (BinaryExpression expr) {
750 295826 : if (expr.checked) {
751 : return;
752 : }
753 295826 : expr.accept_children (this);
754 : }
755 :
756 1370 : public override void visit_type_check (TypeCheck expr) {
757 1370 : if (expr.checked) {
758 : return;
759 : }
760 1370 : expr.accept_children (this);
761 : }
762 :
763 5865 : public override void visit_conditional_expression (ConditionalExpression expr) {
764 5865 : if (expr.checked) {
765 : return;
766 : }
767 5865 : expr.accept_children (this);
768 : }
769 :
770 6050 : public override void visit_lambda_expression (LambdaExpression l) {
771 6050 : if (l.checked) {
772 : return;
773 : }
774 6050 : l.accept_children (this);
775 : }
776 :
777 114139 : public override void visit_assignment (Assignment a) {
778 114139 : if (a.checked) {
779 : return;
780 : }
781 114139 : a.accept_children (this);
782 : }
783 : }
|