Skip to content

Freeze casts of bare constants to typed PsConstantExprs

The type of the argument to a cast is hard to infer because there is no context from the enclosing scope. Unless a typed symbol appears in the argument, the typifier has no way to determine the type of the argument. For more discussion see #97.

This MR fixes the issue for casts of bare constants, e.g. CastFunc(0, float64) by freezing them to constants of the target type directly. Additionally, the typifier now raises an error if the type of an argument to a cast can not be determined.

Edited by Daniel Bauer

Merge request reports