diff --git a/test/libsolidity/syntaxTests/functionTypes/error_deprecate_value_constructor_nonpayable.sol b/test/libsolidity/syntaxTests/functionTypes/error_deprecate_value_constructor_nonpayable.sol new file mode 100644 index 000000000..4cc674570 --- /dev/null +++ b/test/libsolidity/syntaxTests/functionTypes/error_deprecate_value_constructor_nonpayable.sol @@ -0,0 +1,11 @@ +contract C { + constructor() {} +} +contract D { + function createC() public returns (C) { + C c = (new C).value(2)(); + return c; + } +} +// ---- +// TypeError 8827: (107-120): Constructor for contract C must be payable for member "value" to be available. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/call_option_value_on_library_function.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/call_option_value_on_library_function.sol new file mode 100644 index 000000000..a5b57253a --- /dev/null +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/call_option_value_on_library_function.sol @@ -0,0 +1,8 @@ +library L { function l() public {} } +contract test { + function f() public { + L.l{value: 1}(); + } +} +// ---- +// TypeError 2193: (87-100): Function call options can only be set on external function calls or contract creations.