parapluu / encore

The Encore compiler.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consuming unsafe types is allowed

helanhalvan opened this issue · comments

class Main
   def main(args:[String]) : unit
        var derp = new Foo()
        consume derp
   end
end
unsafe class Foo
end

As this example shows, compiling unsafe types and then consuming them gives no compiler warnings or errors. As consume is an operation that only really makes sense on linear things, I find this weird. If this is by design, just close this issue. If this is a side effect or the current design, don't.