Skip to content

Commit 0f86892

Browse files
committed
Blurb about struct types and their global namespace.
1 parent 1ef3a85 commit 0f86892

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

documentation/language/03_data_types.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,25 @@ program test.aleo {
193193
```
194194

195195

196+
### Structs
196197

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.
197201

202+
```leo
203+
program test.aleo {
204+
struct S {
205+
x: field,
206+
y: u32,
207+
}
198208
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

Comments
 (0)