Avatar
protocol ASTNode : CustomStringConvertible { func accept<V: ASTThrowsVisitor>(visitor: V) throws -> V.VisitResult } extension ASTNode { func accept<V: ASTVisitor>(visitor: V) -> V.VisitResult { return try! accept(visitor: visitor) } } これでさ、
4:08 AM
protocol ASTVisitor: ASTThrowsVisitor { associatedtype VisitResult func visit(nop: NopNode) -> VisitResult ... } extension ASTVisitor { func visit(nop: NopNode) throws -> VisitResult { return visit(nop: nop) } } こうしたらいけないかね
4:09 AM
protocol ASTThrowsVisitor { associatedtype VisitResult func visit(nop: NopNode) throws -> VisitResult .... } これ忘れてた