diff options
Split out SolidityNameAndTypeResolution tests into SyntaxTests
Diffstat (limited to 'test/libsolidity/syntaxTests/nameAndTypeResolution/130_enum_implicit_conversion_is_not_okay_256.sol')
-rw-r--r-- | test/libsolidity/syntaxTests/nameAndTypeResolution/130_enum_implicit_conversion_is_not_okay_256.sol | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/130_enum_implicit_conversion_is_not_okay_256.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/130_enum_implicit_conversion_is_not_okay_256.sol new file mode 100644 index 00000000..359deba5 --- /dev/null +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/130_enum_implicit_conversion_is_not_okay_256.sol @@ -0,0 +1,10 @@ +contract test { + enum ActionChoices { GoLeft, GoRight, GoStraight, Sit } + function test() public { + a = ActionChoices.GoStraight; + } + uint256 a; +} +// ---- +// Warning: (80-148): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead. +// TypeError: (117-141): Type enum test.ActionChoices is not implicitly convertible to expected type uint256. |