Closed swernli closed 3 years ago
This is a tricky one. I think the monomorphization itself is resolved with one of the latest PRs I did. However, I don't think that is actually what would prevent this from working; I believe that when building the callable value, we may actually need to make some special accommodations. I'll look into it with my next batch of fixing things.
Different manifestation of the same issue: https://github.com/microsoft/qsharp-compiler/issues/955
Fixed with #990.
The standard library includes two functions,
RectangularArrayFact
andSquareArrayFact
, that make use of the genericLength
function as a parameter while using an inherited type specifier:Any(Compose(NotEqualI(numColumns, _), Length<'T>), Rest(array))
This fails QIR generation in the compiler with the errorwhen trying to process the argument tuple. It's unclear whether this is an issue specific to QIR generation or perhaps a corner case interaction with Monomorphization (maybe the generic doesn't get fully resolved in the callable tree?). We can work around this in the libraries for now, since it only occurs in those two functions, but we should investigate a fix to ensure QIR generation can handle this case.