-
-
Notifications
You must be signed in to change notification settings - Fork 124
Description
What Git revision are you using?
What operating system are you using, and which version?
- Linux / Ubuntu
- Linux / Other
- macOS
- Windows
Describe what the problem is?
I noted at least two problems when using the Pair
constructor. In both cases, the type-checker fails (rightfully in the second case) with a wrong and confusing error message.
-
When using the constructor as a partial function:
fuzz.map2(Pair, cardano.credential(), fuzz.int_at_least(1))
Here,
map2
first argument should befn(a, b) -> Pair(a, b)
, which in principlePair
satisfies. But instead of providing a relevant error, the compiler fails pointing at an unknown constructorPair
. -
If we misuse
Pair
passing only one argument; for example:Pair(Credential.Script(permissions_validator_hash, 0))
The compiler fails again with an unknown constructor error about
Pair
; confusing.
What should be the expected behavior?
In the first scenario, we the use of Pair
as a function should simply be allowed, like it is for all other constructors.
In the second scenario, the compiler should instead raise an incorrect arity error.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status