- Using instructions from http://dev.iachieved.it/iachievedit/building-swift-3-0-on-a-raspberry-pi-3/
- Download image from https://wiki.ubuntu.com/ARM/RaspberryPi
- Check Disk Utility for device
- Unmount card's filesystem, if mounted
// xcrun swift generic-link-error.swift | |
// produces: | |
// LLVM ERROR: Program used external function '_OBJC_METACLASS_$__TtC4main1A' which could not be resolved! | |
import Cocoa | |
class A<X> : NSObject { | |
override class func keyPathsForValuesAffectingValueForKey(key: String) -> Set<String> { | |
return super.keyPathsForValuesAffectingValueForKey(key) |
import Cocoa | |
class A<T> : NSViewController { | |
var x:T? = nil | |
override init?(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { | |
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) | |
} | |
} | |
class B : A<NSString> { | |
override init?(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { |
func f(code:Void -> Void) { | |
print("no throw version called") | |
code() | |
} | |
func f<Result>(code:Void throws -> Result) rethrows -> Result { | |
print("rethrow version called") | |
return try code() | |
} |
import JavaScriptCore | |
let ctx = JSGlobalContextCreate(nil) | |
let trueValue = JSValueMakeBoolean(ctx, true) | |
// This returns false in both Xcode 7.3.1 and 8.0 b2. | |
JSValueIsObject(ctx, trueValue) | |
// This returns true in Xcode 7.3.1, and false in 8.0 b2. | |
JSValueIsBoolean(ctx, trueValue) |
import Foundation | |
/* | |
xcrun swift objc-throwing-block.swift | |
objc-throwing-block.swift:20:13: error: method cannot be marked @objc because the type of the parameter cannot be represented in Objective-C | |
@objc func access(accessor: Accessor) {} | |
^ | |
objc-throwing-block.swift:20:30: note: throwing function types cannot be represented in Objective-C |
import Foundation | |
let u = URL(fileURLWithPath: "/tmp/missing-path", isDirectory: true) | |
let d = FileManager.default.enumerator(at:u, includingPropertiesForKeys: nil, errorHandler: {_,_ in return false})! | |
print("d \(d)") // --> d <NSURLDirectoryEnumerator: 0x100a01940> | |
// Crashes, unless the error handler above is replaced with nil | |
for _ in d {} |
% ./utils/build-script --release-debuginfo --debug-swift | |
#### hours pass #### | |
% ../build/Ninja-RelWithDebInfoAssert+swift-DebugAssert/swift-macosx-x86_64/bin/swift -sdk /Applications/Xcode-9.1b2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -target arm64-apple-ios11.1 /Users/bungi/Desktop/TransitiveAppExtensionAvailable/Example.swift | |
<unknown>:0: error: unable to load standard library for target 'arm64-apple-ios11.1' |
# Trying to get the fastest incremental build times for small changes to the swift compiler. | |
# This still rebuilds the stdlib on each change to the compiler (no --skip option I see to avoid that). | |
[preset: ios] | |
release | |
debug-swift | |
ios | |
skip-build-ios-simulator | |
skip-test-ios-simulator | |
skip-build-osx | |
skip-test-osx |
/* | |
swift SetPrototype.swift | |
On 10.13.4, the result is 'undefined', but it should be '5'. | |
*/ | |
import Foundation | |
import JavaScriptCore | |
var definition:JSClassDefinition = kJSClassDefinitionEmpty |