aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/controlFlow/uninitializedAccess/struct.sol
diff options
context:
space:
mode:
Diffstat (limited to 'test/libsolidity/syntaxTests/controlFlow/uninitializedAccess/struct.sol')
-rw-r--r--test/libsolidity/syntaxTests/controlFlow/uninitializedAccess/struct.sol11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/controlFlow/uninitializedAccess/struct.sol b/test/libsolidity/syntaxTests/controlFlow/uninitializedAccess/struct.sol
new file mode 100644
index 00000000..b4f2be5d
--- /dev/null
+++ b/test/libsolidity/syntaxTests/controlFlow/uninitializedAccess/struct.sol
@@ -0,0 +1,11 @@
+contract C {
+ struct S { uint a; }
+ S s;
+ function f() internal returns (S storage r)
+ {
+ r.a = 0;
+ r = s;
+ }
+}
+// ----
+// TypeError: (109-110): This variable is of storage pointer type and can be accessed without prior assignment.