From 210fee571fb786751763e731f6fb107891e13383 Mon Sep 17 00:00:00 2001 From: Leonardo Alt Date: Mon, 30 Jul 2018 16:43:50 +0200 Subject: Fix crash when FunctionType has undeclared type as parameter --- .../290_varM_disqualified_as_keyword.sol | 11 ----------- .../290_varM_disqualified_as_keyword_1.sol | 7 +++++++ .../290_varM_disqualified_as_keyword_2.sol | 7 +++++++ .../290_varM_disqualified_as_keyword_3.sol | 7 +++++++ .../570_function_type_undeclared_type.sol | 5 +++++ .../571_function_type_undeclared_type_external.sol | 5 +++++ .../572_function_type_undeclared_type_multi_nested.sol | 5 +++++ 7 files changed, 36 insertions(+), 11 deletions(-) delete mode 100644 test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword.sol create mode 100644 test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword_1.sol create mode 100644 test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword_2.sol create mode 100644 test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword_3.sol create mode 100644 test/libsolidity/syntaxTests/nameAndTypeResolution/570_function_type_undeclared_type.sol create mode 100644 test/libsolidity/syntaxTests/nameAndTypeResolution/571_function_type_undeclared_type_external.sol create mode 100644 test/libsolidity/syntaxTests/nameAndTypeResolution/572_function_type_undeclared_type_multi_nested.sol (limited to 'test') diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword.sol deleted file mode 100644 index 1b6bbae7..00000000 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword.sol +++ /dev/null @@ -1,11 +0,0 @@ -contract test { - function f() public { - uintM something = 3; - intM should = 4; - bytesM fail = "now"; - } -} -// ---- -// DeclarationError: (50-55): Identifier not found or not unique. -// DeclarationError: (79-83): Identifier not found or not unique. -// DeclarationError: (104-110): Identifier not found or not unique. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword_1.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword_1.sol new file mode 100644 index 00000000..0d0a0797 --- /dev/null +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword_1.sol @@ -0,0 +1,7 @@ +contract test { + function f() public { + uintM something = 3; + } +} +// ---- +// DeclarationError: (50-55): Identifier not found or not unique. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword_2.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword_2.sol new file mode 100644 index 00000000..b9590a8c --- /dev/null +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword_2.sol @@ -0,0 +1,7 @@ +contract test { + function f() public { + intM should = 4; + } +} +// ---- +// DeclarationError: (50-54): Identifier not found or not unique. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword_3.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword_3.sol new file mode 100644 index 00000000..85d4c25b --- /dev/null +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/290_varM_disqualified_as_keyword_3.sol @@ -0,0 +1,7 @@ +contract test { + function f() public { + bytesM fail = "now"; + } +} +// ---- +// DeclarationError: (50-56): Identifier not found or not unique. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/570_function_type_undeclared_type.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/570_function_type_undeclared_type.sol new file mode 100644 index 00000000..962f4fe4 --- /dev/null +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/570_function_type_undeclared_type.sol @@ -0,0 +1,5 @@ +contract C { + function a(function(Nested)) external pure {} +} +// ---- +// DeclarationError: (37-43): Identifier not found or not unique. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/571_function_type_undeclared_type_external.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/571_function_type_undeclared_type_external.sol new file mode 100644 index 00000000..735af9e9 --- /dev/null +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/571_function_type_undeclared_type_external.sol @@ -0,0 +1,5 @@ +contract C { + function a(function(Nested) external) external pure {} +} +// ---- +// DeclarationError: (37-43): Identifier not found or not unique. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/572_function_type_undeclared_type_multi_nested.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/572_function_type_undeclared_type_multi_nested.sol new file mode 100644 index 00000000..ffb467cd --- /dev/null +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/572_function_type_undeclared_type_multi_nested.sol @@ -0,0 +1,5 @@ +contract C { + function a(function(function(function(Nested)))) external pure {} +} +// ---- +// DeclarationError: (55-61): Identifier not found or not unique. -- cgit