dova: Report error if can't infer element type for list/set/map literals
[vala-lang.git] / doc / vala / methods.xml
blobb7ac154e5da0531d16bfc49da0394e3fda38c2d6
1 <?xml version="1.0"?>
2 <section id="methods">
3         <h>Methods</h>
4         <section id="declaration">
5                 <h>Method declarations</h>
6                 <p>Methods may be declared in namespaces, classes, interfaces, structs, enums, and error domains</p>
7                 <blockquote>
8 method-declaration:
9         [ access-modifier ] [ member-modifers ] return-type qualified-identifier ( [ parameter-list ] ) method-contract [ <l>throws</l> error-list ] <l>{</l> statement-list <l>}</l>
11 member-modifiers:
12         member-modifier [ member-modifiers ]
14 member-modifier:
15         <l>abstract</l>
16         <l>class</l>
17         <l>extern</l>
18         <l>inline</l>
19         <l>override</l>
20         <l>static</l>
21         <l>virtual</l>
23 return-type:
24         type
25         <l>void</l>
27 parameter-list:
28         [ parameter-direction ] type identifier [ <l>,</l> parameter-list ]
30 parameter-direction:
31         <l>ref</l>
32         <l>out</l>
34 method-contract:
35         [ <l>requires</l> <l>(</l> expression <l>)</l> ] [ <l>ensures</l> <l>(</l> expression <l>)</l> ]
37 error-list:
38         error-type [ <l>,</l> error-list ]
40 </blockquote>
41         </section>
42 </section>