I hereby claim:
- I am rintaro on github.
- I am rintaro (https://keybase.io/rintaro) on keybase.
- I have a public key ASCHIvpCLvJuEq6o9l9EGlHrF11twuH5NrTd763RBkZKLQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
$ ~/swift-DEVELOPMENT-SNAPSHOT-2016-10-25-a-ubuntu15.10/usr/bin/swift -frontend -parse validation-test/compiler_crashers/28209-swift-protocoldecl-requiresclassslow.swift | |
validation-test/compiler_crashers/28209-swift-protocoldecl-requiresclassslow.swift:8:13: error: expected '{' in protocol type | |
protocol a:b | |
^ | |
validation-test/compiler_crashers/28209-swift-protocoldecl-requiresclassslow.swift:9:20: error: expected '{' in protocol type | |
protocol b:Range<b> | |
^ | |
swift: /home/buildnode/jenkins/workspace/oss-swift-package-linux-ubuntu-15_10/swift/lib/AST/Decl.cpp:2659: bool swift::ProtocolDecl::requiresClassSlow(): Assertion `isInheritedProtocolsValid() || isBeingTypeChecked()' failed. | |
0 swift 0x00000000031176c8 | |
1 swift 0x00000000031182a6 |
import argparse | |
class Args(object): | |
def __setattr__(self, key, val): | |
e = key.split(".", 1) | |
if len(e) == 1: | |
self.__dict__[key] = val | |
else: | |
(ns, key) = e |
swift/utils/build-script -R -T --llbuild --swiftpm --xctest --foundation -- --reconfigure
swift/utils/build-script --preset=buildbot_incremental,tools=RA,stdlib=RA
swift/utils/build-script -R -T --llbuild --swiftpm --xctest --foundation -- --reconfigure
swift/utils/build-script -R -T --llbuild --swiftpm --xctest --foundation -- --reconfigure
public class Pokemon { | |
private init() {} | |
public var name: String { fatalError() } | |
} | |
private class Pikachu: Pokemon { | |
override var name: String { return "ピカチュウ" } | |
} | |
private class Snorlax: Pokemon { |
/// generate sequence of all values from arbitrary Enum type | |
/// Works with Swift 1.1 | |
/// No support for Enum with associated values. | |
func iterateEnum<T: Hashable>(_: T.Type) -> GeneratorOf<T> { | |
var cast: (Int -> T)! | |
switch sizeof(T) { | |
case 0: return GeneratorOf(GeneratorOfOne(unsafeBitCast((), T.self))) | |
case 1: cast = { unsafeBitCast(UInt8(truncatingBitPattern: $0), T.self) } | |
case 2: cast = { unsafeBitCast(UInt16(truncatingBitPattern: $0), T.self) } | |
case 4: cast = { unsafeBitCast(UInt32(truncatingBitPattern: $0), T.self) } |
// | |
// dump memory of a value | |
// Usage: | |
// memDump(1) | |
// memDump(1 as Int?) | |
// memDump(1 as Any) | |
// | |
func memDump<T>(var v: T) { | |
let bytesPtr = withUnsafePointer(&v, { UnsafePointer<UInt8>($0) }) |
// | |
// NSAttributedString+AttributedFormat.h | |
// AttributedFormat | |
// | |
// Created by rintaro on 11/28/14. | |
// Copyright (c) 2014 rintaro. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
struct CoalesceFilterSequence<Base: SequenceType, T>:SequenceType { | |
let _base:Base | |
let _includeElement:(Base.Generator.Element) -> T? | |
init(_ base: Base, includeElement: (Base.Generator.Element) -> T?) { | |
_base = base | |
_includeElement = includeElement | |
} | |
var http = require('http'); | |
http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello World\n'); | |
}).listen(1337, "127.0.0.1"); | |
console.log('Server running at http://127.0.0.1:1337/'); |