Skip to content

Commit d999f87

Browse files
committed
Clean up
1 parent 979dfd9 commit d999f87

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Sources/Ast.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,5 @@ struct KeywordArgumentExpression: Expression {
122122
}
123123

124124
struct NullLiteral: Literal {
125-
var value: Any? = nil
125+
var value: Any? = nil
126126
}

Sources/Environment.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,15 @@ class Environment {
167167
return ObjectValue(value: object)
168168
case is NullValue:
169169
return NullValue()
170-
case Optional<Any>.none:
171-
return NullValue()
170+
// case Optional<Any>.none:
171+
// return NullValue()
172172
default:
173173
throw JinjaError.runtime("Cannot convert to runtime value: \(input) type:\(type(of: input))")
174174
}
175175
}
176176

177177
@discardableResult
178-
func set(name: String, value: Any?) throws -> any RuntimeValue {
178+
func set(name: String, value: Any) throws -> any RuntimeValue {
179179
try self.declareVariable(name: name, value: self.convertToRuntimeValues(input: value))
180180
}
181181

Sources/Runtime.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct BooleanValue: RuntimeValue {
3535
}
3636

3737
struct NullValue: RuntimeValue {
38-
var value: Any? = nil
38+
var value: (any RuntimeValue)?
3939
var builtins: [String: any RuntimeValue] = [:]
4040

4141
func bool() -> Bool {

0 commit comments

Comments
 (0)