Skip to content

type() does not work on unions #738

@yfinkelstein

Description

@yfinkelstein

u = Union[bool, i32, i64, float, str] (True)

print f"u = {u}, type(u) = {type(u)}"

results in compilation error:

internal.codon:228 (56-57): error: __ptr__() only takes identifiers or tuple fields as arguments
├─ internal.codon:287 (28-75): error: during the realization of union_get_data(u: TypeWrap[Union[Int[32] | Int[64] | bool | float | str]], T: Int[32])
├─ str.codon:27 (20-48): error: during the realization of union_str(union: TypeWrap[Union[Int[32] | Int[64] | bool | float | str]])

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions