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
I ran into a wierd decRef error with the below code:
let test = () => {
let mut dependencyExists = false
(() => {
print(dependencyExists)
})()
(() => {
print(dependencyExists)
})()
return dependencyExists
}
print(test())
This also happens if dependencyExists is a char or really any stack type. However if it is a Number, or heap type this error does not occur. Some cases that do work are below:
let test = () => {
let dependencyExists = box(void)
(() => {
print(dependencyExists)
})()
(() => {
print(dependencyExists)
})()
return dependencyExists
}
print("Test1")
print(test())
let test = () => {
let mut dependencyExists = 1
(() => {
print(dependencyExists)
})()
(() => {
print(dependencyExists)
})()
return dependencyExists
}
print("Test2")
print(test())
The text was updated successfully, but these errors were encountered:
I stumbled upon some more cases where this is occurring:
module Main
from "set" include Set
use Set.{ module Immutable as Set }
from "array" include Array
Array.reduce((argResult, arg) => {
Set.empty
}, Set.empty, [> 1, 1, 1, 1])
print("me")
Which also fails when refactored as below as if the reduce was inlined (to verify the behaviour):
module Main
from "set" include Set
use Set.{ module Immutable as Set }
from "array" include Array
let test = () => {
let mut acc = Set.empty
Array.forEach(el => acc = ((_, _) => {
Set.empty
})(acc, el), [>1, 1, 1, 1])
}
test()
I ran into a wierd decRef error with the below code:
This also happens if dependencyExists is a char or really any stack type. However if it is a Number, or heap type this error does not occur. Some cases that do work are below:
The text was updated successfully, but these errors were encountered: