mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	Don't include location in a message about binding function to a type
This commit is contained in:
		
							parent
							
								
									d5428af5bb
								
							
						
					
					
						commit
						4c9a58eb0f
					
				| @ -3798,7 +3798,7 @@ void TypeChecker::endVisit(UsingForDirective const& _usingFor) | |||||||
| 				path->location(), | 				path->location(), | ||||||
| 				"The function \"" + joinHumanReadable(path->path(), ".") + "\" " + | 				"The function \"" + joinHumanReadable(path->path(), ".") + "\" " + | ||||||
| 				"does not have any parameters, and therefore cannot be bound to the type \"" + | 				"does not have any parameters, and therefore cannot be bound to the type \"" + | ||||||
| 				(normalizedType ? normalizedType->humanReadableName() : "*") + "\"." | 				(normalizedType ? normalizedType->toString(true /* withoutDataLocation */) : "*") + "\"." | ||||||
| 			); | 			); | ||||||
| 
 | 
 | ||||||
| 		FunctionType const* functionType = dynamic_cast<FunctionType const&>(*functionDefinition.type()).asBoundFunction(); | 		FunctionType const* functionType = dynamic_cast<FunctionType const&>(*functionDefinition.type()).asBoundFunction(); | ||||||
| @ -3811,7 +3811,7 @@ void TypeChecker::endVisit(UsingForDirective const& _usingFor) | |||||||
| 				3100_error, | 				3100_error, | ||||||
| 				path->location(), | 				path->location(), | ||||||
| 				"The function \"" + joinHumanReadable(path->path(), ".") + "\" "+ | 				"The function \"" + joinHumanReadable(path->path(), ".") + "\" "+ | ||||||
| 				"cannot be bound to the type \"" + _usingFor.typeName()->annotation().type->humanReadableName() + | 				"cannot be bound to the type \"" + _usingFor.typeName()->annotation().type->toString(true /* withoutDataLocation */) + | ||||||
| 				"\" because the type cannot be implicitly converted to the first argument" + | 				"\" because the type cannot be implicitly converted to the first argument" + | ||||||
| 				" of the function (\"" + functionType->selfType()->humanReadableName() + "\")" + | 				" of the function (\"" + functionType->selfType()->humanReadableName() + "\")" + | ||||||
| 				( | 				( | ||||||
|  | |||||||
| @ -11,4 +11,4 @@ contract C { | |||||||
| } | } | ||||||
| // ---- | // ---- | ||||||
| // TypeError 3100: (112-114): The function "id" cannot be bound to the type "uint256" because the type cannot be implicitly converted to the first argument of the function ("uint16"). | // TypeError 3100: (112-114): The function "id" cannot be bound to the type "uint256" because the type cannot be implicitly converted to the first argument of the function ("uint16"). | ||||||
| // TypeError 3100: (140-142): The function "id" cannot be bound to the type "struct S storage pointer" because the type cannot be implicitly converted to the first argument of the function ("uint16"). | // TypeError 3100: (140-142): The function "id" cannot be bound to the type "struct S" because the type cannot be implicitly converted to the first argument of the function ("uint16"). | ||||||
|  | |||||||
| @ -0,0 +1,5 @@ | |||||||
|  | struct S { uint8 x; } | ||||||
|  | function f() {} | ||||||
|  | using {f} for S; | ||||||
|  | // ---- | ||||||
|  | // TypeError 4731: (45-46): The function "f" does not have any parameters, and therefore cannot be bound to the type "struct S". | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user