Unmanaged issues in Swift Beta 5

The following Unmanaged call breaks in Swift Beta 5.
import Foundation

var obj = NSObject()
var unretainedRefToObject = Unmanaged.passUnretained(obj)
Apparently, the compiler is unhappy:
Stored value type does not match pointer operand type!
  store %CSo8NSObject* %0, %objc_object** %.targetPtr._value, align 8, !dbg !879
 %objc_object*LLVM ERROR: Broken function found, compilation aborted!
Command /Applications/Xcode6-Beta5.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

Workaround (hack)

We’re using this workaround which stores a COpaquePointer:
import Foundation

var obj = NSObject()
var opaquePointerToUnretainedRefToObj = Unmanaged.passUnretained(obj).toOpaque()
Using the reference now requires one more step (and associated type bookkeeping):
var value = Unmanaged<NSObject>.fromOpaque(opaquePointerToUnretainedRefToObj).takeUnretainedValue()