Skip to content

Commit

Permalink
Extract local variable for invocation.Interpreter
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdrag00nv2 committed Sep 6, 2023
1 parent 131a163 commit d169d09
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions runtime/interpreter/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3634,19 +3634,21 @@ var runtimeTypeConstructors = []runtimeTypeConstructor{
panic(errors.NewUnreachableError())
}

inter := invocation.Interpreter

ty := typeValue.Type
// InclusiveRanges must hold integers
elemSemaTy := invocation.Interpreter.MustConvertStaticToSemaType(ty)
elemSemaTy := inter.MustConvertStaticToSemaType(ty)
if !elemSemaTy.Tag().BelongsTo(sema.IntegerTypeTag) {
return Nil
}

return NewSomeValueNonCopying(
invocation.Interpreter,
inter,
NewTypeValue(
invocation.Interpreter,
inter,
NewInclusiveRangeStaticType(
invocation.Interpreter,
inter,
ty,
),
),
Expand Down

0 comments on commit d169d09

Please sign in to comment.