libmir / mir-algorithm

Dlang Core Library
http://mir-algorithm.libmir.org
Other
174 stars 37 forks source link

fuse on array of string #441

Open fabienmica opened 2 years ago

fabienmica commented 2 years ago
string[][] data = [["100", "1Y"], ["200", "2Y"], ["300", "3Y"]];  
data.fuse;  

This does not compile, because it goes to char level instead and shape do not match.
I also tried fuseAs!string but does not compile either.

jmh530 commented 2 years ago

Looks like fuse calls fuseShape, which fails. This bug occurs with any array of strings.

It looks like the function looks through to the deep element type. So for instance,

writeln(fuseShape([100])); //prints [1]
writeln(fuseShape("100")); //prints [3]
writeln(fuseShape("1Y")); //prints [2]