fixed implicit conversion of integer literals to float

This commit is contained in:
Ilya Puchka
2017-12-29 17:26:38 +01:00
parent a4b75f3c89
commit 79a16854e7
4 changed files with 19 additions and 3 deletions

View File

@@ -63,8 +63,11 @@ public struct Variable : Equatable, Resolvable {
return String(variable[variable.characters.index(after: variable.startIndex) ..< variable.characters.index(before: variable.endIndex)])
}
// Number literal
if let int = Int(variable) {
return int
}
if let number = Number(variable) {
// Number literal
return number
}