Skip to content
Snippets Groups Projects

Freeze casts of bare constants to typed PsConstantExprs

Merged Daniel Bauer requested to merge hyteg/pystencils:bauerd/cast-bare-constant into v2.0-dev

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply