Skip to content

[typetraits] type names should resolve to name of resolved type; currently, not consistent #8570

@timotheecour

Description

@timotheecour
import typetraits
import timn/util

type
  A = object
  B = object
  C[T] = object

type MyInt = int
type C2=C

type A2=A
echo A2 # A; (case_A2)

type MyInt2 = int
echo MyInt2 # MyInt2 # case_MyInt2 BUG=> should be int (otherwise inconsistent with case_A2)

type MyInt3 = MyInt2
echo MyInt3 # MyInt2 ; mixing rules case_A2 and case_MyInt2...

type MyInt_distinct = distinct int
echo MyInt_distinct # MyInt_distinct: ok, it's a distinct type

echo C2 # C2 BUG=> should be C (otherwise inconsistent with case_A2)
echo C2[MyInt] # C2[t01_resolveTypeName.MyInt]

NOTE: related but not identical to #8569 ; although if this bug gets fixed by resolving type names to name of resolved type, then #8569 would automatically get fixed

proposal:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions