Skip to content

Commit

Permalink
Merge branch 'master' into tuple-subscript
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyapuchka authored Dec 27, 2017
2 parents 15b8092 + a4b75f3 commit 80f479e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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, in Swift 4 string literals became `Substring` and thus couldn't be directly compared to strings.
- Fixed subscription tuples by value index, i.e. `{{ tuple.0 }}`


Expand Down
2 changes: 1 addition & 1 deletion Sources/Variable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 80f479e

Please sign in to comment.