We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ef3a85 commit 0f86892Copy full SHA for 0f86892
documentation/language/03_data_types.md
@@ -193,6 +193,25 @@ program test.aleo {
193
```
194
195
196
+### Structs
197
198
+Struct types are declared and constructed with a familiar syntax. Note that there is a global namespace for struct
199
+types across your program and its dependencies. If a dependency declares a struct type `T`, you may access that type
200
+without any qualifier.
201
202
+```leo
203
+program test.aleo {
204
+ struct S {
205
+ x: field,
206
+ y: u32,
207
+ }
208
209
+ transition foo(y: u32) -> S {
210
+ let s: S = S {
211
+ x: 172field,
212
+ y,
213
+ };
214
+ return s;
215
216
+}
217
+```
0 commit comments