Skip to content

Instantly share code, notes, and snippets.

@mikelikespie
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikelikespie/669bc4814ed6f30a88ff to your computer and use it in GitHub Desktop.
Save mikelikespie/669bc4814ed6f30a88ff to your computer and use it in GitHub Desktop.
infinite hang in swift
public class Promise<T> {
}
/// These are basically promises that won't terminate until they hit the end
public enum MoreOrEnd<T> {
public typealias ValueTuple = (T, Promise<MoreOrEnd<T>>)
case More(ValueTuple)
case End
}
/// Constructing this will hang
Promise<MoreOrEnd<Int>>()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment