Skip to content

Commit

Permalink
Ignore 'Never' type in super-type calculation for hetergeneous types
Browse files Browse the repository at this point in the history
  • Loading branch information
SupunS committed Jul 25, 2024
1 parent 6fa876b commit 5e772b0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions runtime/sema/type_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,11 @@ func commonSuperTypeOfHeterogeneousTypes(types []Type) Type {
var hasStructs, hasResources, allHashableStructs bool
allHashableStructs = true
for _, typ := range types {
// Ignore 'Never' type as it doesn't affect the supertype.
if typ == NeverType {
continue
}

isResource := typ.IsResourceType()
hasResources = hasResources || isResource
hasStructs = hasStructs || !isResource
Expand Down

0 comments on commit 5e772b0

Please sign in to comment.