Open trocher opened 1 year ago
for 0abcf452b29f5348cb14233fd9a8444224392184
we have this related poc:
def foo(b: Bytes[32], s: String[32]):
String[64] = concat(s, b)
AttributeError: type object 'StringT' has no attribute 'typ'
During handling of the above exception, another exception occurred:
vyper.exceptions.CompilerPanic: unhandled exception type object 'StringT' has no attribute 'typ'
contract "tests/custom/test4.vy:2", function "foo", line 2:4
1 def foo(b: Bytes[32], s: String[32]):
---> 2 String[64] = concat(s, b)
-----------^
This is an unhandled internal compiler error. Please create an issue on Github to notify the developers!
https://github.com/vyperlang/vyper/issues/new?template=bug.md
Version Information
vyper --version
): 0.3.8+commit.4ae2527fpython --version
): 3.8.0What's your issue about?
The compiler outputs an
AttributeError
when trying to use a type as an argument to a function for the following types while it would return aInvalidReference
for other types:For example:
How can it be fixed?
This seems to happen when trying to get the type of the
value
of the Subscript representing the type. Theisinstance
test shown below returnsFalse
ast
is not an instance ofVyperType
but a class inheriting it (In the case above:<class 'vyper.semantics.types.bytestrings.StringT'>
.https://github.com/vyperlang/vyper/blob/02339dfda0f3caabad142060d511d10bfe93c520/vyper/semantics/analysis/utils.py#L314-L322