# Context.followWithAbstracts( \_, true ) reduces intermediate typedefs in one step

**URL:** <https://community.haxe.org/t/context-followwithabstracts-true-reduces-intermediate-typedefs-in-one-step/1337>\
**Category:** Haxe\
**Created:** [December 3, 2018, 7:42pm UTC](https://community.haxe.org/t/context-followwithabstracts-true-reduces-intermediate-typedefs-in-one-step/1337 "2018-12-03T19:42:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SaintAnne](https://avatars.discourse-cdn.com/v2/letter/s/65b543/32.png) [@SaintAnne](https://community.haxe.org/u/SaintAnne)\
**Post date:** [December 3, 2018, 7:42pm UTC](https://community.haxe.org/t/context-followwithabstracts-true-reduces-intermediate-typedefs-in-one-step/1337/1 "2018-12-03T19:42:03Z")

</div>

With haxe 4 preview 5

```haxe
typedef A = Int;
typedef B = A;
typedef C = B;
typedef D = C;
typedef E = D;

abstract F(E) {}

```

```haxe
        var t = ComplexTypeTools.toType( TPath( { pack: [], name: 'F' } ) );
        for ( i in 0 ... 7 ) {
            trace( t );
            t = Context.followWithAbstracts( t, true );
        }

```

output:

```haxe
TAbstract(F,[])
TAbstract(Int,[])
TAbstract(Int,[])
TAbstract(Int,[])
TAbstract(Int,[])
TAbstract(Int,[])
TAbstract(Int,[])

```

Also it would have been nice if follow/followWith… returned Option or something, to know when type was fully reduced and you should stop iterating. Because now it makes new instance of Type and you can’t just == them.

---

<div class="post-metadata">

**Author:** ![Simn](https://community.haxe.org/user_avatar/community.haxe.org/simn/32/388_2.png) [@Simn](https://community.haxe.org/u/Simn)\
**Post date:** [December 4, 2018, 12:17pm UTC](https://community.haxe.org/t/context-followwithabstracts-true-reduces-intermediate-typedefs-in-one-step/1337/2 "2018-12-04T12:17:58Z")

</div>

Please open an issue!

---

<div class="post-metadata">

**Author:** ![SaintAnne](https://avatars.discourse-cdn.com/v2/letter/s/65b543/32.png) [@SaintAnne](https://community.haxe.org/u/SaintAnne)\
**Post date:** [December 4, 2018, 6:50pm UTC](https://community.haxe.org/t/context-followwithabstracts-true-reduces-intermediate-typedefs-in-one-step/1337/3 "2018-12-04T18:50:27Z")

</div>

Sorry, I can’t.
