MCPcopy Create free account
hub / github.com/argotorg/solidity / interfaceType

Method interfaceType

libsolidity/ast/Types.cpp:1979–2010  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1977}
1978
1979TypeResult ArrayType::interfaceType(bool _inLibrary) const
1980{
1981 if (_inLibrary && m_interfaceType_library.has_value())
1982 return *m_interfaceType_library;
1983
1984 if (!_inLibrary && m_interfaceType.has_value())
1985 return *m_interfaceType;
1986
1987 TypeResult result{nullptr};
1988 TypeResult baseInterfaceType = m_baseType->interfaceType(_inLibrary);
1989
1990 if (!baseInterfaceType.get())
1991 {
1992 solAssert(!baseInterfaceType.message().empty(), "Expected detailed error message!");
1993 result = baseInterfaceType;
1994 }
1995 else if (_inLibrary && location() == DataLocation::Storage)
1996 result = this;
1997 else if (m_arrayKind != ArrayKind::Ordinary)
1998 result = TypeProvider::withLocation(this, DataLocation::Memory, true);
1999 else if (isDynamicallySized())
2000 result = TypeProvider::array(DataLocation::Memory, baseInterfaceType);
2001 else
2002 result = TypeProvider::array(DataLocation::Memory, baseInterfaceType, m_length);
2003
2004 if (_inLibrary)
2005 m_interfaceType_library = result;
2006 else
2007 m_interfaceType = result;
2008
2009 return result;
2010}
2011
2012Type const* ArrayType::finalBaseType(bool _breakIfDynamicArrayType) const
2013{

Callers 9

generateMethod · 0.45
formatTypeMethod · 0.45
visitMethod · 0.45
endVisitMethod · 0.45
fullEncodingTypeMethod · 0.45
isDynamicallyEncodedMethod · 0.45

Calls 8

abortMethod · 0.80
finalBaseTypeMethod · 0.80
valueTypeMethod · 0.80
structDefinitionMethod · 0.80
getMethod · 0.45
emptyMethod · 0.45
runMethod · 0.45
categoryMethod · 0.45

Tested by

no test coverage detected