Internal error: System.AggregateException: One or more errors occurred. ---> System.Exception: Invalid record

(wdb) #1

IDE: Fire
Version: Version 10.0.0.2400 (develop) built on talax, 20190426-155608. Commit f04dec1.
Target (If relevant): iOS
Description:
I am getting an internal compiler when trying to compile the code listed below the error is as follows:

E:                   Internal error: System.AggregateException: One or more errors occurred. (Invalid record) ---> System.Exception: Invalid record
  at RemObjects.Elements.Toffee.Output.ObjcOutput+<>c__DisplayClass14.<EmitModule>b__0 () [0x004ea] in <1c1fa47eb93d460dbb8783995b95fbec>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.<GenerateExecutable>b__16 (System.Action a) [0x00000] in <1c1fa47eb93d460dbb8783995b95fbec>:0 
  at System.Threading.Tasks.Parallel+<>c__DisplayClass44_0`2[TSource,TLocal].<PartitionerForEachWorker>b__1 (System.Collections.IEnumerator& partitionState, System.Int32 timeout, System.Boolean& replicationDelegateYieldedBeforeCompletion) [0x0010f] in <fcbcc99210424b63b9d0b88bd11ce160>:0 
--- End of stack trace from previous location where exception was thrown ---

  at System.Threading.Tasks.Parallel+<>c__DisplayClass44_0`2[TSource,TLocal].<PartitionerForEachWorker>b__1 (System.Collections.IEnumerator& partitionState, System.Int32 timeout, System.Boolean& replicationDelegateYieldedBeforeCompletion) [0x0026e] in <fcbcc99210424b63b9d0b88bd11ce160>:0 
  at System.Threading.Tasks.TaskReplicator+Replica`1[TState].ExecuteAction (System.Boolean& yieldedBeforeCompletion) [0x00000] in <fcbcc99210424b63b9d0b88bd11ce160>:0 
  at System.Threading.Tasks.TaskReplicator+Replica.Execute () [0x00023] in <fcbcc99210424b63b9d0b88bd11ce160>:0 
   --- End of inner exception stack trace ---
  at System.Threading.Tasks.TaskReplicator.Run[TState] (System.Threading.Tasks.TaskReplicator+ReplicatableUserAction`1[TState] action, System.Threading.Tasks.ParallelOptions options, System.Boolean stopOnFirstFailure) [0x0005b] in <fcbcc99210424b63b9d0b88bd11ce160>: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) [0x00188] in <fcbcc99210424b63b9d0b88bd11ce160>:0 
--- End of stack trace from previous location where exception was thrown ---

  at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException (System.Collections.ICollection exceptions, System.Threading.CancellationToken cancelToken, System.Exception otherException) [0x0000b] in <fcbcc99210424b63b9d0b88bd11ce160>: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) [0x001e7] in <fcbcc99210424b63b9d0b88bd11ce160>:0 
  at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal] (System.Collections.Generic.IEnumerable`1[T] source, System.Threading.Tasks.ParallelOptions parallelOptions, System.Action`1[T] body, 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) [0x00050] in <fcbcc99210424b63b9d0b88bd11ce160>:0 
  at System.Threading.Tasks.Parallel.ForEach[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Action`1[T] body) [0x0001c] in <fcbcc99210424b63b9d0b88bd11ce160>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.GenerateExecutable () [0x00f60] in <1c1fa47eb93d460dbb8783995b95fbec>:0 
  at RemObjects.Oxygene.Code.Compiler.Compiler.GenerateExecutable () [0x00000] in <0aadd9d9d08743939cc40bd957af8eec>:0 
  at RemObjects.Oxygene.Code.Compiler.Compiler.Compile () [0x001a0] in <0aadd9d9d08743939cc40bd957af8eec>:0 
---> (Inner Exception #0) System.Exception: Invalid record
  at RemObjects.Elements.Toffee.Output.ObjcOutput+<>c__DisplayClass14.<EmitModule>b__0 () [0x004ea] in <1c1fa47eb93d460dbb8783995b95fbec>:0 
  at RemObjects.Elements.Toffee.Output.ObjcOutput.<GenerateExecutable>b__16 (System.Action a) [0x00000] in <1c1fa47eb93d460dbb8783995b95fbec>:0 
  at System.Threading.Tasks.Parallel+<>c__DisplayClass44_0`2[TSource,TLocal].<PartitionerForEachWorker>b__1 (System.Collections.IEnumerator& partitionState, System.Int32 timeout, System.Boolean& replicationDelegateYieldedBeforeCompletion) [0x0010f] in <fcbcc99210424b63b9d0b88bd11ce160>:0 
--- End of stack trace from previous location where exception was thrown ---

  at System.Threading.Tasks.Parallel+<>c__DisplayClass44_0`2[TSource,TLocal].<PartitionerForEachWorker>b__1 (System.Collections.IEnumerator& partitionState, System.Int32 timeout, System.Boolean& replicationDelegateYieldedBeforeCompletion) [0x0026e] in <fcbcc99210424b63b9d0b88bd11ce160>:0 
  at System.Threading.Tasks.TaskReplicator+Replica`1[TState].ExecuteAction (System.Boolean& yieldedBeforeCompletion) [0x00000] in <fcbcc99210424b63b9d0b88bd11ce160>:0 
  at System.Threading.Tasks.TaskReplicator+Replica.Execute () [0x00023] in <fcbcc99210424b63b9d0b88bd11ce160>:0 <---

Expected Behavior:
I am expecting this code to compile

Actual Behavior:
I am getting an internal compiler error as listed above

Also I am getting a few warnings regarding the switch-statement which I am not sure should be expected which is:

Comparing a value type with a reference type will box the value type and evaluates to "False" [/Users/x/Desktop/Bug/CodeInsight/App22/RootViewController.swift (9)]`

I would expect I should be able to check if SignInProcess is touchID or usernamePassword

Steps:

  1. Create simple iOS application
  2. Copy the listed code in the RootViewController-file
  3. Notice compiler error

Problematic code:

import UIKit

public enum SignInProcess: String {
    case touchID
    case usernamePassword
    
    fileprivate func onWillAppear(_ signInViewController: RootViewController) {
        switch self {
            case .usernamePassword: signInViewController.initiateUserNamePassword()
            default: break // Do nothing
        }
    }

    fileprivate func onDidAppear(_ signInViewController: RootViewController) {
        switch self {
            case .touchID: signInViewController.initiateTouchIDOnce()
            case .usernamePassword: signInViewController.initiateUserNamePassword(focus: signInViewController.usernameTextField)
            default: break
        }
    }   
}

@IBObject class RootViewController : UIViewController {
    public var usernameTextField: UITextField!

    public override func viewDidLoad() {

        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }
    
    public override func viewWillAppear(_ animated: BOOL) {
        self.initiateUserNamePassword(focus: nil)
    }
    
    public func initiateTouchIDOnce() {
    }
    public func initiateUserNamePassword(withFocus focus: UITextField? = nil) {
        Foundation.NSLog("LoginViewController.initiateUserNamePassword()")
    }

    public override func didReceiveMemoryWarning() {

        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
}
(RemObjects) #2

Thanks, logged as bugs://82477

1 Like
(RemObjects) #3

bugs://82477 got closed with status fixed.