W.xueshan
W.xueshan

Reputation: 35

What's the meaning of type 'd in q#

enter image description here

As shown in the picture above. What's the meaning of type 'd? What's type the return value of "Zipped" should be?

Upvotes: 0

Views: 52

Answers (1)

Mariia Mykhailova
Mariia Mykhailova

Reputation: 2032

Types like 'd or 'c appear in the error messages when the Q# compiler fails to infer types of any values involved. In this case, there is a type mismatch between the return of Zipped, which is an array of tuples, and the return type of the operation, which from the screenshot looks like Double[][], an array of arrays of double.

Edit: In this particular case the compiler knows the return type produced by Zipped, so it should use it instead of a generic. There's an issue opened in the Q# compiler repo for this - thank you for bringing this up!

Upvotes: 1

Related Questions