aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-04-11 23:44:44 +0800
committerchriseth <chris@ethereum.org>2018-04-12 04:00:21 +0800
commitb5a696ad48780bf0614eef2a737a2e89963d4640 (patch)
treefcc1d4e910eef36fef15fca3e036f3039146450c /test/libsolidity
parent52f68d3b63d65c31215e683899b96b27e2e24ee1 (diff)
downloaddexon-solidity-b5a696ad48780bf0614eef2a737a2e89963d4640.tar.gz
dexon-solidity-b5a696ad48780bf0614eef2a737a2e89963d4640.tar.zst
dexon-solidity-b5a696ad48780bf0614eef2a737a2e89963d4640.zip
Properly cope with constructor headers.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/syntaxTests/functionTypes/function_type_constructor.sol7
-rw-r--r--test/libsolidity/syntaxTests/functionTypes/function_type_constructor_local.sol8
2 files changed, 15 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/functionTypes/function_type_constructor.sol b/test/libsolidity/syntaxTests/functionTypes/function_type_constructor.sol
new file mode 100644
index 00000000..95ebc179
--- /dev/null
+++ b/test/libsolidity/syntaxTests/functionTypes/function_type_constructor.sol
@@ -0,0 +1,7 @@
+contract C {
+ // Fool parser into parsing a constructor as a function type.
+ constructor() x;
+}
+// ----
+// Warning: (83-99): Modifiers of functions without implementation are ignored.
+// DeclarationError: (97-98): Undeclared identifier.
diff --git a/test/libsolidity/syntaxTests/functionTypes/function_type_constructor_local.sol b/test/libsolidity/syntaxTests/functionTypes/function_type_constructor_local.sol
new file mode 100644
index 00000000..b7763d28
--- /dev/null
+++ b/test/libsolidity/syntaxTests/functionTypes/function_type_constructor_local.sol
@@ -0,0 +1,8 @@
+contract C {
+ // Fool parser into parsing a constructor as a function type.
+ function f() {
+ constructor() x;
+ }
+}
+// ----
+// ParserError: (118-118): Expected token Semicolon got 'Identifier'