HPInc / HP-Digital-Microfluidics

HP Digital Microfluidics Software Platform and Libraries
MIT License
3 stars 1 forks source link

DML reciprocal expressions yielding wrong type #301

Closed EvanKirshenbaum closed 10 months ago

EvanKirshenbaum commented 10 months ago

Currently, if you write 2 per second in DML, it will correctly return a value of 2 Hz, but it is asserting that to be a time value.

Migrated from internal repository. Originally created by @EvanKirshenbaum on Aug 17, 2023 at 1:38 PM PDT. Closed on Aug 17, 2023 at 3:31 PM PDT.
EvanKirshenbaum commented 10 months ago

This issue was referenced by the following commit before migration:

EvanKirshenbaum commented 10 months ago

It now looks through the representation types for the given type (e.g., Type.TIME for second), computes the reciprocal dimension, and looks for a type corresponding to that dimension. If it doesn't find one, it throws an exception.

While I was there, I changed DMLCompiler.visit() to catch CompilationError and turn it into a returned error Executable. This should prevent a lot of stack dumps in the future.

Migrated from internal repository. Originally created by @EvanKirshenbaum on Aug 17, 2023 at 3:31 PM PDT.