Skip to content

Commit 6725612

Browse files
committed
Rust codegen: document reference printing
1 parent 743f9d6 commit 6725612

File tree

1 file changed

+4
-3
lines changed
  • lambda-buffers-codegen/src/LambdaBuffers/Codegen/Rust/Print

1 file changed

+4
-3
lines changed

lambda-buffers-codegen/src/LambdaBuffers/Codegen/Rust/Print/LamVal.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,14 @@ printCaseTextE pkgs iTyDefs txtVal cases otherCase = do
318318

319319
{- | Print a reference
320320
321+
HACK(szg251)
321322
To help Rust type inference, we inject type information for a few references.
322-
In case of a `toPlutusData`, `fromPlutusData`, `toJson`, `fromJson` we call the reference as a trait
323-
method on the target type:
323+
In case of trait methods and associated functions, such as `toPlutusData`, `fromPlutusData`,
324+
`toJson`, `fromJson` we call the reference as a trait method on the target type:
324325
```rs
325326
<TargetType>::to_plutus_data(...)
326327
```
327-
In case of `jsonConstructor`, we print the target type in a turbofish syntax:
328+
In case of functions with a generic argument, such as `jsonConstructor`, we print the target type in a turbofish syntax:
328329
```rs
329330
lbr_prelude::json::json_constructr::<TargetType>::toPlutusData(...)
330331
```

0 commit comments

Comments
 (0)