Skip to content

Commit

Permalink
sema: set the Kind field of constants in fitBitsize function
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Jul 24, 2024
1 parent 4bed7c0 commit cbf5466
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions std/jule/sema/eval.jule
Original file line number Diff line number Diff line change
Expand Up @@ -4247,17 +4247,20 @@ fn fitBitsize(mut &d: &Data) {
| d.Constant.IsI64():
k = types::BitsizeOfInt(d.Constant.ReadI64())
if k > z {
d.Kind = findBuiltinTypeAlias(types::IntFromBits(k)).Kind.Kind
d.Constant.Kind = types::IntFromBits(k)
d.Kind = findBuiltinTypeAlias(d.Constant.Kind).Kind.Kind
}
| d.Constant.IsU64():
k = types::BitsizeOfUint(d.Constant.ReadU64())
if k > z {
d.Kind = findBuiltinTypeAlias(types::UintFromBits(k)).Kind.Kind
d.Constant.Kind = types::UintFromBits(k)
d.Kind = findBuiltinTypeAlias(d.Constant.Kind).Kind.Kind
}
| d.Constant.IsF64():
k = types::BitsizeOfFloat(d.Constant.ReadF64())
if k > z {
d.Kind = findBuiltinTypeAlias(types::FloatFromBits(k)).Kind.Kind
d.Constant.Kind = types::FloatFromBits(k)
d.Kind = findBuiltinTypeAlias(d.Constant.Kind).Kind.Kind
}
}
}
Expand Down

0 comments on commit cbf5466

Please sign in to comment.