Skip to content

[clarity] type-checker error with list of callable principals #4622

@obycode

Description

@obycode

Describe the bug
This Clarity code that appears valid gets an error from the type-checker:

(replace-at?
    (list
      'SK1655DMX0A8VKB0W7R2EN6B29MS98G1HTZV2XW41.CKPAbAeaxopNIumug
      'ST3Z7C6C0Q0VWBM06788X4P386517JNEAYTN1SRB7.euEUmoKftalFLQpCsmeswgNWQQcRelTgmVVSY
      'S12R7Q5M2WN8PYVPNH9RXHMHV1GDX1PCT9XQFZ1VF.zQurKADWgvZWXBvpAb
    )
    u1
    'SK1655DMX0A8VKB0W7R2EN6B29MS98G1HTZV2XW41.CKPAbAeaxopNIumug
)

Steps To Reproduce
Example unit test:

#[test]
fn test_replace_at_callable() {
    let contract = "(replace-at?
        (list
          'SK1655DMX0A8VKB0W7R2EN6B29MS98G1HTZV2XW41.CKPAbAeaxopNIumug
          'ST3Z7C6C0Q0VWBM06788X4P386517JNEAYTN1SRB7.euEUmoKftalFLQpCsmeswgNWQQcRelTgmVVSY
          'S12R7Q5M2WN8PYVPNH9RXHMHV1GDX1PCT9XQFZ1VF.zQurKADWgvZWXBvpAb
        )
        u1
        'SK1655DMX0A8VKB0W7R2EN6B29MS98G1HTZV2XW41.CKPAbAeaxopNIumug
      )";

    assert!(mem_type_check(contract).is_ok());
}

Expected behavior
This should be valid Clarity code.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Status: 🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions