Skip to content

Commit

Permalink
respond to review
Browse files Browse the repository at this point in the history
  • Loading branch information
dsainati1 committed Dec 13, 2023
1 parent 600eafc commit 59e9af8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion migrations/entitlements/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ func ConvertValueToEntitlements(
semaType := inter.MustConvertStaticToSemaType(staticType)
entitledType := ConvertToEntitledType(semaType)

// if the types of the values are equal and the value is not a runtime type, there's nothing to migrate
if entitledType.Equal(semaType) && !entitledType.Equal(sema.MetaType) {
return nil
}

switch v := v.(type) {
case *interpreter.EphemeralReferenceValue:
entitledReferenceType := entitledType.(*sema.ReferenceType)
Expand Down Expand Up @@ -220,7 +225,7 @@ func ConvertValueToEntitlements(

case *interpreter.TypeValue:
if v.Type == nil {
return v
return nil
}

Check warning on line 229 in migrations/entitlements/migration.go

View check run for this annotation

Codecov / codecov/patch

migrations/entitlements/migration.go#L228-L229

Added lines #L228 - L229 were not covered by tests
// convert the static type of the value
entitledStaticType := interpreter.ConvertSemaToStaticType(
Expand Down

0 comments on commit 59e9af8

Please sign in to comment.