Skip to content

Instantly share code, notes, and snippets.

@protocool
Created July 29, 2015 17:03
Show Gist options
  • Save protocool/ecbd9016bf37c5b6f080 to your computer and use it in GitHub Desktop.
Save protocool/ecbd9016bf37c5b6f080 to your computer and use it in GitHub Desktop.

Revisions

  1. protocool created this gist Jul 29, 2015.
    23 changes: 23 additions & 0 deletions sigill.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    import Foundation

    protocol P {
    typealias PT: NSObject = Self
    static func vendSpecific() -> PT?
    }

    extension P where Self: NSObject, PT == Self {
    static func vendSpecific() -> PT? {
    return nil
    }
    }

    class A: NSObject, P {
    }

    class B: A {
    typealias PT = B
    }

    func compilerSIGILL() {
    B.vendSpecific()
    }