Empty class in Swift Playground gives __lldb_expr_ error

Choosing an empty class on Swift Playground will give you the error __ lldb_expr _

//: Playground - noun: a place where people can play

import UIKit

class FooBar {

}

let foo = FooBar()

      

See attached screenshot. __lldb_expr_4 at line 12 on attempted instantiation of class FooBar

This happens in Xcode version 6.3.1 (6D1002) . I've also tried with the latest Xcode 6.4 beta 3 - Version 6.4 (6E7) - available May 11, 2015. The same error occured.

Empty classes are built seamlessly in a regular Swift project.

The error can be avoided simply by adding a dummy constant like this:

//: Playground - noun: a place where people can play

import UIKit

class FooBar {
    let wibble = 10
}

let foo = FooBar()

      

Was surprised by this error, considering that creating an initial empty class is such a basic thing. In my case, I wanted the scroll delegate class to view the content offsets. It would seem perfectly reasonable to use a delegate without any properties.

Any ideas?

+3


source to share


1 answer


It's not a mistake.



This is the information that the variable foo

now contains an object of the class FooBar

whose internal name __lldb_expr_12.FooBar

. __lldb_expr_12

is the name of the Swift module in the playground in this case.

+7


source







All Articles