From 7756522317d8d076410f7a530fa5d7ac9da66b29 Mon Sep 17 00:00:00 2001 From: Ilya Puchka Date: Tue, 26 Dec 2017 15:51:17 +0100 Subject: [PATCH] fixed error on swift 3.1 --- Sources/Inheritence.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/Inheritence.swift b/Sources/Inheritence.swift index 9662540..dba09cf 100644 --- a/Sources/Inheritence.swift +++ b/Sources/Inheritence.swift @@ -4,8 +4,8 @@ class BlockContext { // contains mapping of block names to their nodes and templates where they are defined var blocks: [String: [(BlockNode, Template?)]] - init(blocks: [String: (BlockNode, Template?)]) { - self.blocks = blocks.mapValues({ [$0] }) + init(blocks: [String: [(BlockNode, Template?)]]) { + self.blocks = blocks } func pushBlock(_ block: BlockNode, named blockName: String, definedIn template: Template?) { @@ -95,7 +95,9 @@ class ExtendsNode : NodeType { blockContext.pushBlock(block, named: name, definedIn: template) } } else { - blockContext = BlockContext(blocks: blocks.mapValues({ ($0, template) })) + var blocks = [String: [(BlockNode, Template?)]]() + self.blocks.forEach { blocks[$0.key] = [($0.value, template)] } + blockContext = BlockContext(blocks: blocks) } do {