Skip to content

unhandled internal error #4733

@logorithm360

Description

@logorithm360

Version Information

  • Vyper Version (output of vyper --version): x.x.x
  • OS: Linux
  • Python Version (output of python --version): x.x.x

What's your issue about?

Error Output

## Error compiling: morning_contract.vy  
---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 "morning_contract.vy:11", line 11:0 
       10
  ---> 11 message_store: String[String[1000]]
  --------^
       12
##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

Command Run

vyper morning_contract.vy

Problematic Code

# pragma version ^0.4.0
# @license MIT

## struct for user info
user_info: HashMap[String[50], uint256]

struct User:
    name: String[50]
    message: String[100]

message_store: String[100][5] # store messages in a list of strings

## initializing the contract
@deploy
def __init__(_name: String[60], message: String[100], message_store: String[10][5], user_info: HashMap(String[50], uint256)):
    """
    Constructor to initialize the contract with a user's name and message.
    """
    self.person: User = User(
        name= _name,
        message = message
    )
    self.message_store = message_store
    self.user_info = user_info
    self.user_info[_name] = 0  # Initialize user info with zero messages

Verbose Output

vyper.exceptions.VyperException: Compilation failed with the following errors:

StructureException: arrays of String[10] are not allowed!

  contract "morning_contract.vy:15", line 15:0 
       14 @deploy
  ---> 15 def __init__(_name: String[60], message: String[100], message_store: String[10][5], user_info: HashMap(String[50], uint256)):
  --------^
       16     """


StructureException: arrays of String[100] are not allowed!

  contract "morning_contract.vy:11", line 11:0 
       10
  ---> 11 message_store: String[100][5] # store messages in a list of strings
  --------^
       12

How can it be fixed?

I don't know yet - can you help fixing it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions