You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running the following advent of code script seems to cause Dictu to hang. After some digging it seems to be because the string value of "Can not convert 'r' to number" for the Error response from toNumber is no longer in the interned strings table and it is stuck in an infinite loop trying to find it
def findNumbers(line) {
var first = nil;
var second = nil;
print(line.len());
for (var i = 0; i < line.len(); i += 1) {
print(line[i], i);
if (line[i].toNumber().success()) {
if (not first) {
first = line[i].toNumber().unwrap();
continue;
}
second = line[i].toNumber().unwrap();
} else {
print(line[i].toNumber().unwrapError());
}
}
return "{}{}".format(first, second or first).toNumber().unwrap();
}
with('input.txt', 'r') {
var line;
var lineNum = 0;
var total = 0;
// When you reach the end of the file, nil is returned
while((line = file.readLine()) != nil) {
lineNum += 1;
print(lineNum);
print(line);
total += findNumbers(line);
print('here?');
}
print(total);
}
It seems as though the release version is fine, however, it gets stuck on the debug version. Potentially a value being cleaned that that is still referenced somewhere
Is there an existing issue for this?
Current Behavior
Running the following advent of code script seems to cause Dictu to hang. After some digging it seems to be because the string value of "Can not convert 'r' to number" for the Error response from
toNumber
is no longer in the interned strings table and it is stuck in an infinite loop trying to find itinput.txt
Expected Behavior
No response
Steps To Reproduce
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: