1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 17:04:47 +03:00

Free.analysis rethrows errors.

This commit is contained in:
Rob Rix 2015-10-28 11:54:40 -04:00
parent 11a2d2700a
commit 2252f8dbe6

View File

@ -21,12 +21,12 @@ public enum Free<Leaf, Annotation, Value>: CustomDebugStringConvertible {
}
public func analysis<C>(@noescape ifPure ifPure: Value -> C, @noescape ifRoll: (Annotation, Syntax<Free, Leaf>) -> C) -> C {
public func analysis<C>(@noescape ifPure ifPure: Value throws -> C, @noescape ifRoll: (Annotation, Syntax<Free, Leaf>) throws -> C) rethrows -> C {
switch self {
case let .Pure(b):
return ifPure(b)
return try ifPure(b)
case let .Roll(s):
return ifRoll(s)
return try ifRoll(s)
}
}