Template level "spread operator" missing type-information required for disambiguation of field names
See original GitHub issueI have a piece of code that works in 1.8, but throws errors on 1.9.
It seems that let MyType{..} = var
loses some type-information required for disambiguation of field names.
Here is a minimum example
module SpreadOperator where
data DataTypeOne = DataTypeOne with
partyName : Party
deriving (Eq, Show)
data DataTypeTwo = DataTypeTwo with
partyName : Party
deriving (Eq, Show)
template ImportTest with
import_var: DataTypeOne
where
let DataTypeOne{..} = import_var
signatory partyName
The error is:
~/tmp/myproject/daml/SpreadOperator.daml:15:15: error:
Ambiguous occurrence 'partyName'
It could refer to
either the field 'partyName',
defined at ~/tmp/myproject/daml/SpreadOperator.daml:8:3
or the field 'partyName',
defined at ~/tmp/myproject/daml/SpreadOperator.daml:4:3
I would expect that let DataTypeOne{..} = import_var
has enough type information do disambiguate.
The issue persists in Daml Connect 1.10.
@garyverhaegen-da mentioned that there was a change to template-level bindings that might be causing it.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Typescript Error and the spread operator arising from ...props?
From what I understand this function accepts a spread operator, so that is meant to say it accepts an object / array with...
Read more >Releases · google/closure-compiler Wiki - GitHub
Introduction. Here's a list of recent releases of Closure Compiler. See the README for how to obtain the latest release. We also update...
Read more >Programming in Standard ML
inferring the missing type information based on context. For example, there is no need to give a type to the variable s in...
Read more >The jOOQ Release Note History
The operator is currently emulated using SQL/XML or SQL/JSON. The resulting documents are parsed again when fetching them from JDBC. Future versions will...
Read more >C++ Core Guidelines - GitHub Pages
If you need a tutorial for some given level of experience, ... For example, many examples are language-technical and use names like f ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Note that the issue persists without the spread operator:
still fails with the same error.
Definitely not urgent as one can easily not use that feature.