Properly cope with constructor headers.

This commit is contained in:
chriseth
2018-04-11 22:00:21 +02:00
parent 52f68d3b63
commit b5a696ad48
3 changed files with 21 additions and 3 deletions
@@ -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.
@@ -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'