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:
parent
11a2d2700a
commit
2252f8dbe6
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user