Skip to content

[Bug]: Intersection types not supported #318

@tasosbit

Description

@tasosbit

Description

Intersection types throw error: Non builtin type must have a name

import { Uint32 } from '@algorandfoundation/algorand-typescript/arc4'

type MyAccount = {
  account: Account
}

type WithId = { id: Uint32 }

type MyAccountWithId = MyAccount & WithId

export class HelloWorld extends Contract {
  hello(name: string): MyAccountWithId {
    const account: MyAccountWithId = {
      account: Txn.sender,
      id: new Uint32(13),
    }
    return account
  }
}

Steps to Reproduce

See code above and repro repo here: https://github.com/tasosbit/repro-puya-ts-intersection-types

Expected Behavior

Intersection types work

Screenshots

No response

Device Info

any

Additional Context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions