diff --git a/CHANGELOG.md b/CHANGELOG.md index fd8e81f..7fb2923 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Fixed rendering `{{ block.super }}` with several levels of inheritance - Fixed checking dictionary values for nil in `default` filter +- Fixed comparing string variables with string literals ## 0.10.1 diff --git a/Sources/Variable.swift b/Sources/Variable.swift index afc5dbd..659cf51 100644 --- a/Sources/Variable.swift +++ b/Sources/Variable.swift @@ -60,7 +60,7 @@ public struct Variable : Equatable, Resolvable { if (variable.hasPrefix("'") && variable.hasSuffix("'")) || (variable.hasPrefix("\"") && variable.hasSuffix("\"")) { // String literal - return variable[variable.characters.index(after: variable.startIndex) ..< variable.characters.index(before: variable.endIndex)] + return String(variable[variable.characters.index(after: variable.startIndex) ..< variable.characters.index(before: variable.endIndex)]) } if let number = Number(variable) {