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
The forward's type is too restrictive. When using nested forward in the following example, an extra variable arg1 is necessary for passing the typecheck. A better way is to relax the forward's type so that no extra variable is used to do the trick.
active class Base
def base() : int
42
end
end
active class Bar
def bar() : int
24
end
end
active class Foo
def foo(b : bool) : int
val arg1 = (new Bar) ! bar()
val arg2 = (new Base) ! base()
forward(if b then
forward(arg1)
arg1 -- required to make typecheck
else
arg2
end)
end
end
active class Main
def main() : unit
println("{}", get((new Foo) ! foo(true)))
println("{}", get((new Foo) ! foo(false)))
end
end
The text was updated successfully, but these errors were encountered:
The
forward
's type is too restrictive. When using nestedforward
in the following example, an extra variablearg1
is necessary for passing the typecheck. A better way is to relax theforward
's type so that no extra variable is used to do the trick.The text was updated successfully, but these errors were encountered: