Int.copy gets monomorphized in the following program:
public fun main() {
_ = Array<Int>()
}
Monomorphization occurs in Array.count with the expression storage.header.copy(). I suspect that name resolution is attaching to copy the generic parameters accumulated by storage.header.
One solution to fix this problem might be to only attach generic arguments of the referred declaration in TypedProgram.referredDecl (as opposed to accumulated generic arguments) and to re-construct the full list during monomorphization. In the above example, it would mean that copy would get associated with any generic argument in TypedProgram.referredDecl.
Int.copy
gets monomorphized in the following program:Monomorphization occurs in
Array.count
with the expressionstorage.header.copy()
. I suspect that name resolution is attaching tocopy
the generic parameters accumulated bystorage.header
.One solution to fix this problem might be to only attach generic arguments of the referred declaration in
TypedProgram.referredDecl
(as opposed to accumulated generic arguments) and to re-construct the full list during monomorphization. In the above example, it would mean thatcopy
would get associated with any generic argument inTypedProgram.referredDecl
.