mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Drop ':' if the source file name is empty
A large number of tests compile contracts while passing in an empty string for the source name. This leads to it being keyed by the name ":<contract>", while the tests try to look it up under the name "<contract>". This change resolves that issue by dropping the ':' in cases where there is, effectively, no source file to prepend anyway.
This commit is contained in:
parent
071b936b37
commit
8f25bd54e3
@ -192,7 +192,8 @@ void ContractDefinition::setUserDocumentation(Json::Value const& _userDocumentat
|
|||||||
|
|
||||||
std::string ContractDefinition::fullyQualifiedName() const
|
std::string ContractDefinition::fullyQualifiedName() const
|
||||||
{
|
{
|
||||||
std::string qualifiedName = *(location().sourceName) + ":" + name();
|
std::string sourceString = *(location().sourceName);
|
||||||
|
std::string qualifiedName = (sourceString.empty() ? ("") : (sourceString + ":")) + name();
|
||||||
return qualifiedName;
|
return qualifiedName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user