Using typealias throws an internal error on compiler

(wdb) #1

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) only difference is that I removed the weak due to a known issue.

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:

@IBObject public class LocationsViewController: UITableViewController {

    private var locations = LocationNodeList()

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

                     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()

(RemObjects) #2

Thanks, logged as bugs://82446

(Carlo Kok) #3

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?

1 Like
(wdb) #4

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

(wdb) #5

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

(Carlo Kok) #6

Got it. Thanks

(RemObjects) #7

bugs://82446 got closed with status fixed.

1 Like
(wdb) #8

Great that was resolved quickly! :slight_smile:

(wdb) #9

Cool, works in the latest build :smiley:

1 Like