Ola Fosheim Grøstad <ola.fosheim.grostad+dl...@gmail.com> wrote: > On Tuesday, 15 September 2015 at 20:34:43 UTC, Tobias Müller wrote: >>> There's a Blog post somewhere but I can't find it atm. >> >> Ok found it: > http://pcwalton.github.io/blog/2012/12/26/typestate-is-dead/ > > But that is for runtime detection, not compile time?
Not as far as I understand it. The marker is a type, not a value. And it's used as template param. But you need non-copyable move-only types for it to work. In D it would probably look like: File!Open file = open(...); File!Closed file = close(file); Tobi