mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	Merge pull request #8865 from a3d4/fix-8712-abi-compiler-error
Fix ABI internal compiler error caused by an internal constructor
This commit is contained in:
		
						commit
						80b4e51fd6
					
				| @ -9,6 +9,7 @@ Compiler Features: | ||||
| 
 | ||||
| 
 | ||||
| Bugfixes: | ||||
|  * ABI: Skip ``private`` or ``internal`` constructors. | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
| @ -73,9 +73,10 @@ Json::Value ABI::generate(ContractDefinition const& _contractDef) | ||||
| 		); | ||||
| 		abi.emplace(std::move(method)); | ||||
| 	} | ||||
| 	if (_contractDef.constructor()) | ||||
| 	FunctionDefinition const* constructor = _contractDef.constructor(); | ||||
| 	if (constructor && constructor->visibility() >= Visibility::Public) | ||||
| 	{ | ||||
| 		FunctionType constrType(*_contractDef.constructor()); | ||||
| 		FunctionType constrType(*constructor); | ||||
| 		FunctionType const* externalFunctionType = constrType.interfaceFunctionType(); | ||||
| 		solAssert(!!externalFunctionType, ""); | ||||
| 		Json::Value method; | ||||
|  | ||||
							
								
								
									
										9
									
								
								test/libsolidity/ABIJson/internal_constructor.sol
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								test/libsolidity/ABIJson/internal_constructor.sol
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | ||||
| // bug #8712 | ||||
| contract B { | ||||
|     uint immutable x; | ||||
|     constructor(function() internal returns(uint) fp) internal { | ||||
|         x = fp(); } | ||||
| } | ||||
| // ---- | ||||
| //     :B | ||||
| // [] | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user