aiken/crates/aiken-lang/src
KtorZ 67493ad847
Fix casting inferrence on patterns
The original goal for this commit was to allow casting from Data on
  patterns without annotation. For example, given some custom type
  'OrderDatum':

  ```
  expect OrderDatum { requested_handle, destination, .. }: OrderDatum = datum
  ```

  would work fine, but:

  ```
  expect OrderDatum { requested_handle, destination, .. } = datum
  ```

  Yet, the annotation feels unnecessary at this point because type can
  be inferred from the pattern itself. So this commit allows, whenever
  possible (ie when the pattern is neither a discard nor a var), to
  infer the type from a pattern.

  Along the way, I also found a couple of weird behaviours surrounding
  this kind of assignments, in particular in combination with let. I'll
  highlight those in the next PR (#979).
2024-07-24 12:42:24 +02:00
..
error Define 'ExtraData' trait for errors 2023-10-20 18:00:12 +02:00
gen_uplc Fix tree traversal node selection for a few of the enum variants 2024-06-25 18:50:00 -04:00
parser Provide better parse errors in trace when using comma instead of colon. 2024-07-19 12:28:08 +02:00
snapshots Automatically merge import lines from same module. 2024-06-04 10:48:42 +02:00
tests Fix casting inferrence on patterns 2024-07-24 12:42:24 +02:00
tipo Fix casting inferrence on patterns 2024-07-24 12:42:24 +02:00
ast.rs Rework 'compact' mode for traces 2024-07-19 12:28:08 +02:00
builtins.rs Add 'diagnostic' to the prelude, as well as companion functions. 2024-07-19 12:28:07 +02:00
expr.rs Allow variadic arguments in trace 2024-07-18 10:01:34 +02:00
format.rs Allow variadic arguments in trace 2024-07-18 10:01:34 +02:00
gen_uplc.rs Fix casting inferrence on patterns 2024-07-24 12:42:24 +02:00
levenshtein.rs Add function to calculate lenvenshtein distance of two strings 2022-12-22 23:44:15 +01:00
lib.rs Add 'diagnostic' to the prelude, as well as companion functions. 2024-07-19 12:28:07 +02:00
line_numbers.rs feat: impl serde on errythang 2024-03-08 19:19:07 -05:00
parser.rs Automatically merge import lines from same module. 2024-06-04 10:48:42 +02:00
plutus_version.rs feat: add plutus version to aiken.toml 2024-05-21 17:02:20 -04:00
pretty.rs Remove unused 'FlexBreak' 2023-03-14 16:47:43 -04:00
tipo.rs Fix casting inferrence on patterns 2024-07-24 12:42:24 +02:00