aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests
diff options
context:
space:
mode:
Diffstat (limited to 'test/libsolidity/syntaxTests')
-rw-r--r--test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_internal_functions.sol11
-rw-r--r--test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_special_types.sol13
-rw-r--r--test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs.sol13
-rw-r--r--test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_types.sol16
-rw-r--r--test/libsolidity/syntaxTests/specialFunctions/types_without_encoding_problems.sol9
5 files changed, 62 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_internal_functions.sol b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_internal_functions.sol
new file mode 100644
index 00000000..9f57c3a4
--- /dev/null
+++ b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_internal_functions.sol
@@ -0,0 +1,11 @@
+contract C {
+ function f() public pure {
+ bytes32 h = keccak256(keccak256, f, this.f.gas, block.blockhash);
+ h;
+ }
+}
+// ----
+// TypeError: This type cannot be encoded.
+// TypeError: This type cannot be encoded.
+// TypeError: This type cannot be encoded.
+// TypeError: This type cannot be encoded.
diff --git a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_special_types.sol b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_special_types.sol
new file mode 100644
index 00000000..a7d13215
--- /dev/null
+++ b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_special_types.sol
@@ -0,0 +1,13 @@
+contract C {
+ function f() public pure {
+ bool a = address(this).call(address(this).delegatecall, super);
+ bool b = address(this).delegatecall(log0, tx, mulmod);
+ a; b;
+ }
+}
+// ----
+// TypeError: This type cannot be encoded.
+// TypeError: This type cannot be encoded.
+// TypeError: This type cannot be encoded.
+// TypeError: This type cannot be encoded.
+// TypeError: This type cannot be encoded.
diff --git a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs.sol b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs.sol
new file mode 100644
index 00000000..f27290fd
--- /dev/null
+++ b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs.sol
@@ -0,0 +1,13 @@
+contract C {
+ struct S { uint x; }
+ S s;
+ struct T { }
+ T t;
+ function f() public pure {
+ bytes32 a = sha256(s, t);
+ a;
+ }
+}
+// ----
+// TypeError: This type cannot be encoded.
+// TypeError: This type cannot be encoded.
diff --git a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_types.sol b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_types.sol
new file mode 100644
index 00000000..991b2237
--- /dev/null
+++ b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_types.sol
@@ -0,0 +1,16 @@
+contract C {
+ struct S { uint x; }
+ S s;
+ struct T { }
+ T t;
+ enum A { X, Y }
+ function f() public pure {
+ bool a = address(this).delegatecall(S, A, A.X, T, uint, uint[]);
+ }
+}
+// ----
+// TypeError: This type cannot be encoded.
+// TypeError: This type cannot be encoded.
+// TypeError: This type cannot be encoded.
+// TypeError: This type cannot be encoded.
+// TypeError: This type cannot be encoded.
diff --git a/test/libsolidity/syntaxTests/specialFunctions/types_without_encoding_problems.sol b/test/libsolidity/syntaxTests/specialFunctions/types_without_encoding_problems.sol
new file mode 100644
index 00000000..c8364548
--- /dev/null
+++ b/test/libsolidity/syntaxTests/specialFunctions/types_without_encoding_problems.sol
@@ -0,0 +1,9 @@
+contract C {
+ uint[3] sarr;
+ function f() view public {
+ uint[3] memory arr;
+ bytes32 h = keccak256(this.f, arr, sarr);
+ h;
+ }
+}
+// ----