Fix infer array test

This commit is contained in:
Hirokazu Hata 2019-01-14 22:52:05 +09:00
parent 5d3884d5b4
commit 478ce1c8b5
2 changed files with 57 additions and 40 deletions

View File

@ -343,14 +343,17 @@ fn test(x: &str, y: isize) {
let b = [a, a];
let c = [b, b];
let d = [y];
let e = [d, d];
let f = [e, e];
let d = [y, 1, 2, 3]
let d = [1, y, 2, 3]
let e = [y];
let f = [d, d];
let g = [e, e];
let h = [1, 2];
let i = ["a", "b"];
// we have not infered these case yet.
let g = [1, 2];
let h = ["a", "b"];
let b = [a, ["b"]];
let x: [u8; 0] = [];
}
"#,
"array.txt",

View File

@ -1,38 +1,52 @@
[9; 10) 'x': &str
[18; 19) 'y': isize
[28; 258) '{ ..."]]; }': ()
[38; 39) 'a': [&str,]
[42; 45) '[x]': [&str,]
[28; 291) '{ ... []; }': ()
[38; 39) 'a': [&str]
[42; 45) '[x]': [&str]
[43; 44) 'x': &str
[55; 56) 'b': [[&str,], [&str,]]
[59; 65) '[a, a]': [[&str,], [&str,]]
[60; 61) 'a': [&str,]
[63; 64) 'a': [&str,]
[75; 76) 'c': [[[&str,], [&str,]], [[&str,], [&str,]]]
[79; 85) '[b, b]': [[[&str,], [&str,]], [[&str,], [&str,]]]
[80; 81) 'b': [[&str,], [&str,]]
[83; 84) 'b': [[&str,], [&str,]]
[96; 97) 'd': [isize,]
[100; 103) '[y]': [isize,]
[55; 56) 'b': [[&str]]
[59; 65) '[a, a]': [[&str]]
[60; 61) 'a': [&str]
[63; 64) 'a': [&str]
[75; 76) 'c': [[[&str]]]
[79; 85) '[b, b]': [[[&str]]]
[80; 81) 'b': [[&str]]
[83; 84) 'b': [[&str]]
[96; 97) 'd': [isize]
[100; 112) '[y, 1, 2, 3]': [isize]
[101; 102) 'y': isize
[113; 114) 'e': [[isize,], [isize,]]
[117; 123) '[d, d]': [[isize,], [isize,]]
[118; 119) 'd': [isize,]
[121; 122) 'd': [isize,]
[133; 134) 'f': [[[isize,], [isize,]], [[isize,], [isize,]]]
[137; 143) '[e, e]': [[[isize,], [isize,]], [[isize,], [isize,]]]
[138; 139) 'e': [[isize,], [isize,]]
[141; 142) 'e': [[isize,], [isize,]]
[197; 198) 'g': [_, _]
[201; 207) '[1, 2]': [_, _]
[202; 203) '1': [unknown]
[205; 206) '2': [unknown]
[217; 218) 'h': [_, _]
[221; 231) '["a", "b"]': [_, _]
[222; 225) '"a"': [unknown]
[227; 230) '"b"': [unknown]
[241; 242) 'b': [[&str,], [_,]]
[245; 255) '[a, ["b"]]': [[&str,], [_,]]
[246; 247) 'a': [&str,]
[249; 254) '["b"]': [_,]
[250; 253) '"b"': [unknown]
[104; 105) '1': isize
[107; 108) '2': isize
[110; 111) '3': isize
[121; 122) 'd': [isize]
[125; 137) '[1, y, 2, 3]': [isize]
[126; 127) '1': isize
[129; 130) 'y': isize
[132; 133) '2': isize
[135; 136) '3': isize
[146; 147) 'e': [isize]
[150; 153) '[y]': [isize]
[151; 152) 'y': isize
[163; 164) 'f': [[isize]]
[167; 173) '[d, d]': [[isize]]
[168; 169) 'd': [isize]
[171; 172) 'd': [isize]
[183; 184) 'g': [[isize]]
[187; 193) '[e, e]': [[isize]]
[188; 189) 'e': [isize]
[191; 192) 'e': [isize]
[204; 205) 'h': [_]
[208; 214) '[1, 2]': [_]
[209; 210) '1': [unknown]
[212; 213) '2': [unknown]
[224; 225) 'i': [_]
[228; 238) '["a", "b"]': [_]
[229; 232) '"a"': [unknown]
[234; 237) '"b"': [unknown]
[249; 250) 'b': [[&str]]
[253; 263) '[a, ["b"]]': [[&str]]
[254; 255) 'a': [&str]
[257; 262) '["b"]': [&str]
[258; 261) '"b"': &str
[273; 274) 'x': [u8]
[286; 288) '[]': [u8]