Created
April 3, 2018 14:50
-
-
Save run-dlang/390128568448567156b5c85f51fe9ed5 to your computer and use it in GitHub Desktop.
Code shared from run.dlang.io.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() | |
| { | |
| import std.stdio: write, writeln, writef, writefln; | |
| int i; | |
| enum Foo { E } | |
| Foo f; | |
| i = f; // OK | |
| f = i; // error | |
| f = cast(Foo)i; // OK | |
| f = 0; // error | |
| f = Foo.E; // OK | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment