-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sharable mode annotation might be broken for arrow types #858
Comments
It seems like nested types have problems with the sharable too. For instance, the next example throws the error:
when I thought that it would work. Find the code below: fun appl[sharable a](x: Maybe[Maybe[a]]): Maybe[a]
match x with
case Nothing => Nothing
case Just(y) => y
end
end
linear class X
end
active class Main
def main(): unit
var x = Just(Just(new X))
appl(consume x)
end
end |
I also saw that an option type that wraps a linear type doesn't seem to play at all with the A test case that proves this is given below: fun foo[linear t](var x: t): unit
()
end
fun appl(var x: Maybe[X]): unit
match x with
case Nothing => ()
case Just(y) => foo(consume y)
end
end
linear class X
end
active class Main
def main(): unit
()
end
end I get the error:
|
This is not a bug. The
Your second example has the same problem, and your last example is related to #770. The latter could be fixed by supporting non-destructive |
You are right. I think the message mislead me to believe there was something wrong:
when I read the |
In the current
development
version of Encore, I keep getting the error:For something that I think should typecheck. The minimum code to reproduce this errors is given below:
Am I doing something wrong or did I find a bug?
The text was updated successfully, but these errors were encountered: