| 1977 | } |
| 1978 | |
| 1979 | TypeResult 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 | |
| 2012 | Type const* ArrayType::finalBaseType(bool _breakIfDynamicArrayType) const |
| 2013 | { |
no test coverage detected