Skip to content

Instantly share code, notes, and snippets.

@yutopp
Created January 4, 2014 08:31
Show Gist options
  • Save yutopp/8253085 to your computer and use it in GitHub Desktop.
Save yutopp/8253085 to your computer and use it in GitHub Desktop.
import std.stdio;
struct A
{
void print()
{
a.writeln; # a at line 11
}
}
int a = 72;
void main()
{
(A()).print; #=> 72
struct A
{
void print()
{
a.writeln; # a at line 11
}
}
int a = 42;
(A()).print; #=> 72
}
import std.stdio;
struct A(T)
{
void print()
{
a.writeln;
}
}
int a = 72;
void main()
{
(A!int()).print; #=> 72
struct A(T)
{
void print()
{
a.writeln;
}
}
int a = 42;
(A!int()).print; #=> 42 ←???
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment