exaloop / exaloop/codon

type() does not work on unions

Open
#738 0 comments 0 reactions 1 assignee Claimed by @inumanag View on GitHub
Dominant language
Python
Stars
16.8k
Forks
603
Avg merge
4d 23h
Merged PRs (30d)
6

Description

```

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]])
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.