Details
Description
Type TypeCalculator.infer is used when type constrained resource parameters are validated which means that important information is lost when an error message is printed. The following expression:
define foo(Struct[{b => Integer, d=>String}] $a) { notice $a }
|
foo{ bar: a => {b => 5, c => 'stuff'}}
|
currently results in the following error message:
Error: Expected parameter 'a' of 'Foo[bar]' to have type Struct[{'b'=>Integer, 'd'=>String}], got Hash[String, Scalar]
|
the correct output (when using `infer_set` instead of `infer`) should be:
Error: Expected parameter 'a' of 'Foo[bar]' to have type Struct[{'b'=>Integer, 'd'=>String}], got Struct[{'b'=>Integer, 'c'=>String}]
|