aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/scoping
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-07-13 19:20:39 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-08-01 20:31:04 +0800
commit30d9961efb7c0056a2b189b642489bee92048442 (patch)
tree5da02f7a064b882c64a0a8422cac6e99c6cbc4ca /test/libsolidity/syntaxTests/scoping
parentce99a5ce7f98b3dfb86ea8397a5117332af33f2a (diff)
downloaddexon-solidity-30d9961efb7c0056a2b189b642489bee92048442.tar.gz
dexon-solidity-30d9961efb7c0056a2b189b642489bee92048442.tar.zst
dexon-solidity-30d9961efb7c0056a2b189b642489bee92048442.zip
Do not exclude public state variables when looking for conflicting declarations.
Diffstat (limited to 'test/libsolidity/syntaxTests/scoping')
-rw-r--r--test/libsolidity/syntaxTests/scoping/function_state_variable_conflict.sol6
-rw-r--r--test/libsolidity/syntaxTests/scoping/state_variable_function_conflict.sol6
-rw-r--r--test/libsolidity/syntaxTests/scoping/state_variable_function_conflict_former_crash.sol14
3 files changed, 26 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/scoping/function_state_variable_conflict.sol b/test/libsolidity/syntaxTests/scoping/function_state_variable_conflict.sol
new file mode 100644
index 00000000..d717981b
--- /dev/null
+++ b/test/libsolidity/syntaxTests/scoping/function_state_variable_conflict.sol
@@ -0,0 +1,6 @@
+contract C {
+ function f(uint) public pure {}
+ uint public f = 0;
+}
+// ----
+// DeclarationError: (53-70): Identifier already declared.
diff --git a/test/libsolidity/syntaxTests/scoping/state_variable_function_conflict.sol b/test/libsolidity/syntaxTests/scoping/state_variable_function_conflict.sol
new file mode 100644
index 00000000..0c732f7f
--- /dev/null
+++ b/test/libsolidity/syntaxTests/scoping/state_variable_function_conflict.sol
@@ -0,0 +1,6 @@
+contract C {
+ uint public f = 0;
+ function f(uint) public pure {}
+}
+// ----
+// DeclarationError: (40-71): Identifier already declared.
diff --git a/test/libsolidity/syntaxTests/scoping/state_variable_function_conflict_former_crash.sol b/test/libsolidity/syntaxTests/scoping/state_variable_function_conflict_former_crash.sol
new file mode 100644
index 00000000..fb9180c6
--- /dev/null
+++ b/test/libsolidity/syntaxTests/scoping/state_variable_function_conflict_former_crash.sol
@@ -0,0 +1,14 @@
+// This used to crash with some compiler versions.
+contract SomeContract {
+
+ uint public balance = 0;
+
+ function balance(uint number) public {}
+
+ function doSomething() public {
+ balance(3);
+ }
+}
+// ----
+// DeclarationError: (106-145): Identifier already declared.
+// TypeError: (185-195): Type is not callable