Knocking up an empty class within a Swift Playground gives an error __lldb_expr_
//: Playground - noun: a place where people can play
import UIKit
class FooBar {
}
let foo = FooBar()
See attached screenshot.
This occurs on Xcode Version 6.3.1 (6D1002). I have also tried with the latest Xcode 6.4 beta 3 - Version 6.4 (6E7) - available 11th May 2015. The same error occurs.
Empty classes build without issue in a normal Swift project.
The error can be avoided by simply adding a dummy constant as follows:
//: Playground - noun: a place where people can play
import UIKit
class FooBar {
let wibble = 10
}
let foo = FooBar()
Was surprised at this error given that creating a initial empty class is such a basic thing. In my case I wanted a scroll view delegate class to track content offsets. It would seem entirely reasonable to use a delegate with no properties.
Any ideas?
This is not an error.
It's an information that the variable foo
now holds an object of class FooBar
whose internal name is __lldb_expr_12.FooBar
. __lldb_expr_12
is the Swift module's name in the Playground in this case.