mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
19a74506e3
removed libevmone.so files from the directory trial test cases extracted from SoliidityEndToEndTest.cpp into .sol files. Corresponding code in the .cpp file has been commented instead of begin removed pending preliminary reviews removed libevmone files Added testcase packed_storage_structs_delete added test case invalid_enum_logged added test case enum_referencing added test case memory_types_initialisation added test case return string added test case constant_string_literal.sol removed extractable keyword from solidityEndtoEnd.cpp, moved copying_bytes_multiassigned.sol to array/copying folder, added recv() function to copying_bytes_multiassigned.sol but this test case is failing now change typo error in the name of test case library_staticcall_delegatecal.sol to library_staticcall_delegatecall.sol Added compileToEwasm:false to call_forward_bytes.sol test case and moved it to semanticTests/fallback added compileToEwasm:false line to library_call_in_homestead added compileToEwasm: false line to copying_bytes_multiassign, copy_from_calldata_removes_bytes, enum_referencing, library_call_in_homestead, struct_referencing Added test case internal_types_in_library Added test case mapping_arguments_in_library Added test case mapping_returns_in_library Added test case mapping_returns_in_library_named Added test case using_library_mappings_public Added test case library_function_external Added test case library_stray_values added test case using_library_mappings_return added test case using_library_structs Added test case using_for_function_on_struct and corrections to using_library_structs, using_library_mpapings_return, library_stray_values Added test case using_for_overload added test case using_for_by_name added test case bound_function_in_function added test case bound_function_in_var added test case bound_function_to_string added test case payable_function_calls_library added function call corrections to copying_bytes_multiassign and call_forward_bytes Made changes to the test cases as per comments on PR #12289 mentioned in Changelog.md : Extraced some test cases from SolEndToEnd.cpp
21 lines
458 B
Solidity
21 lines
458 B
Solidity
library D { function length(string memory self) public returns (uint) { return bytes(self).length; } }
|
|
contract C {
|
|
using D for string;
|
|
string x;
|
|
function f() public returns (uint) {
|
|
x = "abc";
|
|
return x.length();
|
|
}
|
|
function g() public returns (uint) {
|
|
string memory s = "abc";
|
|
return s.length();
|
|
}
|
|
}
|
|
// ====
|
|
// compileToEwasm: false
|
|
// compileViaYul: also
|
|
// ----
|
|
// library: D
|
|
// f() -> 3
|
|
// g() -> 3
|