# Using typealias throws an internal error on compiler

**URL:** https://talk.remobjects.com/t/using-typealias-throws-an-internal-error-on-compiler/19250
**Category:** Elements Bugs
**Created:** [April 23, 2019, 10:45pm UTC](https://talk.remobjects.com/t/using-typealias-throws-an-internal-error-on-compiler/19250 "2019-04-23T22:45:27Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![wdb](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/w/22d042/32.png) [@wdb](https://talk.remobjects.com/u/wdb)
#### Post date: [April 23, 2019, 10:45pm UTC](https://talk.remobjects.com/t/using-typealias-throws-an-internal-error-on-compiler/19250/1 "2019-04-23T22:45:27Z")

</div>

**IDE:** Version 10.0.0.2397 (develop) built on bajor, 20190419-153353. Commit 6f2fbf4.  
**Version:** Version 10.0.0.2397 (develop) built on bajor, 20190419-153353. Commit 6f2fbf4.  
**Target** (If relevant): iOS

**Description** :  
In a SharedProject I am having a few typealias’s defined one uses a class `TreeNode` which has been already shown in a different topic (see: [Unable to use weak variables in structs](https://talk.remobjects.com/t/unable-to-use-weak-variables-in-structs/19249/2)) only difference is that I removed the `weak` due to a known issue.

```auto
typealias LocationList = [Location]
typealias LocationNode = TreeNode<Location>
typealias LocationNodeList = [LocationNode]

```

If I now try to use the type alias outside the SharedProject in a iOS project like following:

```auto
@IBObject public class LocationsViewController: UITableViewController {

    private var locations = LocationNodeList()

```

when I try to compile it I am getting the following internal error:

```auto
                     Reference: /Applications/Fire.app/Contents/Resources/Toffee SDKs/iOS 12.2 Simulator/Intents.fx
E: Internal error: System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at RemObjects.Elements.Toffee.Output.ObjcOutput.GetMethod (RemObjects.Oxygene.Code.IMethodInfo aMeth, System.Boolean aSel) [0x00000] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitAssignmentStatement (RemObjects.Oxygene.Code.AssignmentStatement assignmentStatement) [0x002e7] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitStatement (RemObjects.Oxygene.Code.Statement element) [0x00270] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitBeginStatement (RemObjects.Oxygene.Code.BeginStatement beginStatement) [0x0002b] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitStatement (RemObjects.Oxygene.Code.Statement element) [0x0024c] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitBeginStatement (RemObjects.Oxygene.Code.BeginStatement beginStatement) [0x0002b] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitStatement (RemObjects.Oxygene.Code.Statement element) [0x0024c] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitTryFinally (RemObjects.Oxygene.Code.TryStatement tryStatement) [0x000bf] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitStatement (RemObjects.Oxygene.Code.Statement element) [0x0038c] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitArcProtectedBlock (RemObjects.Oxygene.Code.ArcProtectedBlock aBlock) [0x003e1] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitStatement (RemObjects.Oxygene.Code.Statement element) [0x001ed] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitBeginStatement (RemObjects.Oxygene.Code.BeginStatement beginStatement) [0x0002b] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitStatement (RemObjects.Oxygene.Code.Statement element) [0x0024c] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitScopeStatement (RemObjects.Oxygene.Code.ScopeStatement element) [0x00178] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitStatement (RemObjects.Oxygene.Code.Statement element) [0x00235] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.GenerateMethod (RemObjects.Oxygene.Code.IMethodInfo ameth) [0x008fe] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Oxygene.Code.CombinedParsedType.ForAllMethods (System.Func`2[T,TResult] action) [0x00050] in <49a69325a9084390aa0ad4a888bd7f9c>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.GenerateParsedType (RemObjects.Oxygene.Code.IMutableParsedType aType) [0x00132] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.<GenerateExecutable>b__14 (RemObjects.Oxygene.Code.IParsedType a) [0x000c2] in <49787429cfc54208bacb86932509d65a>:0 
  at System.Linq.Enumerable+WhereSelectEnumerableIterator`2[TSource,TResult].MoveNext () [0x00064] in <2392cff65f724abaaed9de072f62bc4a>:0 
  at System.Linq.Enumerable+WhereEnumerableIterator`1[TSource].MoveNext () [0x00062] in <2392cff65f724abaaed9de072f62bc4a>:0 
  at System.Collections.Concurrent.Partitioner+DynamicPartitionerForIEnumerable`1+InternalPartitionEnumerable[TSource].GrabChunk_Buffered (System.Collections.Generic.KeyValuePair`2[System.Int64,TSource][] destArray, System.Int32 requestedChunkSize, System.Int32& actualNumElementsGrabbed) [0x000a5] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0 
   --- End of inner exception stack trace ---
  at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00014] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0 
  at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00052] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0 
  at System.Threading.Tasks.Task.Wait () [0x00000] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0 
  at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal] (System.Collections.Concurrent.Partitioner`1[TSource] source, System.Threading.Tasks.ParallelOptions parallelOptions, System.Action`1[T] simpleBody, System.Action`2[T1,T2] bodyWithState, System.Action`3[T1,T2,T3] bodyWithStateAndIndex, System.Func`4[T1,T2,T3,TResult] bodyWithStateAndLocal, System.Func`5[T1,T2,T3,T4,TResult] bodyWithEverything, System.Func`1[TResult] localInit, System.Action`1[T] localFinally) [0x001a5] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0 
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object
  at RemObjects.Elements.Toffee.Output.ObjcOutput.GetMethod (RemObjects.Oxygene.Code.IMethodInfo aMeth, System.Boolean aSel) [0x00000] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitAssignmentStatement (RemObjects.Oxygene.Code.AssignmentStatement assignmentStatement) [0x002e7] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitStatement (RemObjects.Oxygene.Code.Statement element) [0x00270] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitBeginStatement (RemObjects.Oxygene.Code.BeginStatement beginStatement) [0x0002b] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitStatement (RemObjects.Oxygene.Code.Statement element) [0x0024c] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitBeginStatement (RemObjects.Oxygene.Code.BeginStatement beginStatement) [0x0002b] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitStatement (RemObjects.Oxygene.Code.Statement element) [0x0024c] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitTryFinally (RemObjects.Oxygene.Code.TryStatement tryStatement) [0x000bf] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitStatement (RemObjects.Oxygene.Code.Statement element) [0x0038c] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitArcProtectedBlock (RemObjects.Oxygene.Code.ArcProtectedBlock aBlock) [0x003e1] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitStatement (RemObjects.Oxygene.Code.Statement element) [0x001ed] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitBeginStatement (RemObjects.Oxygene.Code.BeginStatement beginStatement) [0x0002b] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitStatement (RemObjects.Oxygene.Code.Statement element) [0x0024c] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitScopeStatement (RemObjects.Oxygene.Code.ScopeStatement element) [0x00178] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.VisitStatement (RemObjects.Oxygene.Code.Statement element) [0x00235] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.GenerateMethod (RemObjects.Oxygene.Code.IMethodInfo ameth) [0x008fe] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Oxygene.Code.CombinedParsedType.ForAllMethods (System.Func`2[T,TResult] action) [0x00050] in <49a69325a9084390aa0ad4a888bd7f9c>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.GenerateParsedType (RemObjects.Oxygene.Code.IMutableParsedType aType) [0x00132] in <49787429cfc54208bacb86932509d65a>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.<GenerateExecutable>b__14 (RemObjects.Oxygene.Code.IParsedType a) [0x000c2] in <49787429cfc54208bacb86932509d65a>:0 
  at System.Linq.Enumerable+WhereSelectEnumerableIterator`2[TSource,TResult].MoveNext () [0x00064] in <2392cff65f724abaaed9de072f62bc4a>:0 
  at System.Linq.Enumerable+WhereEnumerableIterator`1[TSource].MoveNext () [0x00062] in <2392cff65f724abaaed9de072f62bc4a>:0 
  at System.Collections.Concurrent.Partitioner+DynamicPartitionerForIEnumerable`1+InternalPartitionEnumerable[TSource].GrabChunk_Buffered (System.Collections.Generic.KeyValuePair`2[System.Int64,TSource][] destArray, System.Int32 requestedChunkSize, System.Int32& actualNumElementsGrabbed) [0x000a5] in <dbb16e0bacdc4a0f87478e401bc29b6c>:0 <---

```

**Expected Behavior** :  
An internal error while compiling the code

**Actual Behavior** :  
Successful compilation of the code

**Steps** :

1. Try to compile the project shared on Dropbox mailed to @mh email address

My current workaround is to just use `[TreeNode<Location>]()` instead of `LocationNodeList()`

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [April 24, 2019, 3:06am UTC](https://talk.remobjects.com/t/using-typealias-throws-an-internal-error-on-compiler/19250/2 "2019-04-24T03:06:17Z")

</div>

Thanks, logged as bugs://82446

---

<div class="post-metadata">

### Author: ![ck](https://talk.remobjects.com/user_avatar/talk.remobjects.com/ck/32/8740_2.png) [@ck](https://talk.remobjects.com/u/ck)
#### Post date: [April 24, 2019, 7:50am UTC](https://talk.remobjects.com/t/using-typealias-throws-an-internal-error-on-compiler/19250/3 "2019-04-24T07:50:25Z")

</div>

Hi,

I tried your testcase, but it doesn’t actualy seem to contain the shared project. Any chance of a complete project that shows this problem?

---

<div class="post-metadata">

### Author: ![wdb](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/w/22d042/32.png) [@wdb](https://talk.remobjects.com/u/wdb)
#### Post date: [April 24, 2019, 9:02am UTC](https://talk.remobjects.com/t/using-typealias-throws-an-internal-error-on-compiler/19250/4 "2019-04-24T09:02:40Z")

</div>

Yes, sure. I will upload it to the Dropbox location.

---

<div class="post-metadata">

### Author: ![wdb](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/w/22d042/32.png) [@wdb](https://talk.remobjects.com/u/wdb)
#### Post date: [April 24, 2019, 9:08am UTC](https://talk.remobjects.com/t/using-typealias-throws-an-internal-error-on-compiler/19250/5 "2019-04-24T09:08:43Z")

</div>

Please find the zip file 20190424-100700.zip in Dropbox which has the problem 🙂

---

<div class="post-metadata">

### Author: ![ck](https://talk.remobjects.com/user_avatar/talk.remobjects.com/ck/32/8740_2.png) [@ck](https://talk.remobjects.com/u/ck)
#### Post date: [April 24, 2019, 9:12am UTC](https://talk.remobjects.com/t/using-typealias-throws-an-internal-error-on-compiler/19250/6 "2019-04-24T09:12:38Z")

</div>

Got it. Thanks

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [April 24, 2019, 9:21am UTC](https://talk.remobjects.com/t/using-typealias-throws-an-internal-error-on-compiler/19250/7 "2019-04-24T09:21:27Z")

</div>

bugs://82446 got closed with status fixed.

---

<div class="post-metadata">

### Author: ![wdb](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/w/22d042/32.png) [@wdb](https://talk.remobjects.com/u/wdb)
#### Post date: [April 24, 2019, 10:49am UTC](https://talk.remobjects.com/t/using-typealias-throws-an-internal-error-on-compiler/19250/8 "2019-04-24T10:49:56Z")

</div>

Great that was resolved quickly! 🙂

---

<div class="post-metadata">

### Author: ![wdb](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/w/22d042/32.png) [@wdb](https://talk.remobjects.com/u/wdb)
#### Post date: [April 24, 2019, 11:50am UTC](https://talk.remobjects.com/t/using-typealias-throws-an-internal-error-on-compiler/19250/9 "2019-04-24T11:50:35Z")

</div>

Cool, works in the latest build 😃
