mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	Fix false positive test for type(S).typehash and update error messages
This commit is contained in:
		
							parent
							
								
									e8a311268d
								
							
						
					
					
						commit
						8c1a9af76a
					
				| @ -329,7 +329,7 @@ TypePointers TypeChecker::typeCheckMetaTypeFunctionAndRetrieveReturnType(Functio | ||||
| 			4259_error, | ||||
| 			arguments.front()->location(), | ||||
| 			"Invalid type for argument in the function call. " | ||||
| 			"An enum type, contract type or an integer type is required, but " + | ||||
| 			"An enum type, contract type, struct type or an integer type is required, but " + | ||||
| 			type(*arguments.front())->humanReadableName() + " provided." | ||||
| 		); | ||||
| 
 | ||||
|  | ||||
| @ -5,4 +5,4 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ---- | ||||
| // TypeError 4259: (93-98): Invalid type for argument in the function call. An enum type, contract type or an integer type is required, but type(bytes storage pointer) provided. | ||||
| // TypeError 4259: (93-98): Invalid type for argument in the function call. An enum type, contract type, struct type or an integer type is required, but type(bytes storage pointer) provided. | ||||
|  | ||||
| @ -6,4 +6,4 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ---- | ||||
| // TypeError 4259: (126-139): Invalid type for argument in the function call. An enum type, contract type or an integer type is required, but error MyCustomError(uint256,bool) provided. | ||||
| // TypeError 4259: (126-139): Invalid type for argument in the function call. An enum type, contract type, struct type or an integer type is required, but error MyCustomError(uint256,bool) provided. | ||||
|  | ||||
| @ -6,4 +6,4 @@ contract C { | ||||
|     } | ||||
| } | ||||
| // ---- | ||||
| //  TypeError 4259: (124-137): Invalid type for argument in the function call. An enum type, contract type or an integer type is required, but event MyCustomEvent(uint256) provided. | ||||
| //  TypeError 4259: (124-137): Invalid type for argument in the function call. An enum type, contract type, struct type or an integer type is required, but event MyCustomEvent(uint256) provided. | ||||
|  | ||||
| @ -10,4 +10,4 @@ contract SuperTest is Other { | ||||
| 	} | ||||
| } | ||||
| // ---- | ||||
| // TypeError 4259: (177-182): Invalid type for argument in the function call. An enum type, contract type or an integer type is required, but type(contract super SuperTest) provided. | ||||
| // TypeError 4259: (177-182): Invalid type for argument in the function call. An enum type, contract type, struct type or an integer type is required, but type(contract super SuperTest) provided. | ||||
|  | ||||
| @ -14,4 +14,4 @@ abstract contract Test is ERC165 { | ||||
|     } | ||||
| } | ||||
| // ---- | ||||
| // TypeError 4259: (592-597): Invalid type for argument in the function call. An enum type, contract type or an integer type is required, but type(contract super Test) provided. | ||||
| // TypeError 4259: (592-597): Invalid type for argument in the function call. An enum type, contract type, struct type or an integer type is required, but type(contract super Test) provided. | ||||
|  | ||||
| @ -50,4 +50,4 @@ contract D is B, C { | ||||
|     } | ||||
| } | ||||
| // ---- | ||||
| // TypeError 4259: (426-431): Invalid type for argument in the function call. An enum type, contract type or an integer type is required, but type(contract super B) provided. | ||||
| // TypeError 4259: (426-431): Invalid type for argument in the function call. An enum type, contract type, struct type or an integer type is required, but type(contract super B) provided. | ||||
|  | ||||
| @ -4,4 +4,4 @@ contract Test { | ||||
|     } | ||||
| } | ||||
| // ---- | ||||
| // TypeError 4259: (65-75): Invalid type for argument in the function call. An enum type, contract type or an integer type is required, but type(contract Test) provided. | ||||
| // TypeError 4259: (65-75): Invalid type for argument in the function call. An enum type, contract type, struct type or an integer type is required, but type(contract Test) provided. | ||||
|  | ||||
| @ -1,9 +1,8 @@ | ||||
| contract Test { | ||||
|     struct S { uint x; } | ||||
|     function f() public pure { | ||||
|         // Unsupported for now, but might be supported in the future | ||||
|         type(S); | ||||
|         type(bytes32); | ||||
|     } | ||||
| } | ||||
| // ---- | ||||
| // TypeError 4259: (154-155): Invalid type for argument in the function call. An enum type, contract type or an integer type is required, but type(struct Test.S storage pointer) provided. | ||||
| // TypeError 4259: (154-155): Invalid type for argument in the function call. An enum type, contract type, struct type or an integer type is required, but type(struct Test.S storage pointer) provided. | ||||
|  | ||||
| @ -14,4 +14,4 @@ contract C { | ||||
| // ---- | ||||
| // TypeError 5347: (72-76): Try can only be used with external function calls and contract creation calls. | ||||
| // TypeError 2536: (119-128): Try can only be used with external function calls and contract creation calls. | ||||
| // TypeError 4259: (176-183): Invalid type for argument in the function call. An enum type, contract type or an integer type is required, but type(address) provided. | ||||
| // TypeError 4259: (176-183): Invalid type for argument in the function call. An enum type, contract type, struct type or an integer type is required, but type(address) provided. | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user