我有这样的代码:
type
TMyDictionary = TDictionary<int, int>;
var
myDict: TMyDictionary;
k, v: integer;
// code to fill the dictionary
for k in myDict.Keys do
begin
v := myDict.Items[k];
// other stuff
end;
随机我看到 'v := myDict.Items[k];' 上抛出异常 其中说 k 无效。
还有人看到这个吗?