[dlang.org] [D-Programming-Language/dlang.org] 8e6570: fix compile error
GitHub via dlang.org
dlang.org at puremagic.com
Sat Apr 9 16:21:32 PDT 2016
Branch: refs/heads/master
Home: https://github.com/D-Programming-Language/dlang.org
Commit: 8e6570ec2bbf6eaef22769cb5fbeac929bdcd0c6
https://github.com/D-Programming-Language/dlang.org/commit/8e6570ec2bbf6eaef22769cb5fbeac929bdcd0c6
Author: Passw <Passw at users.noreply.github.com>
Date: 2016-04-10 (Sun, 10 Apr 2016)
Changed paths:
M spec/declaration.dd
Log Message:
-----------
fix compile error
```d
import std.stdio;
ref int func2()
{
static int y = 0;
writeln("y \t" , y);
return y;
}
void main()
{
func2() = 2; // The return value of func2() can be modified.
assert(func2() == 2);
auto x = func2();
pragma(msg, typeof(x));
static assert(is(typeof(x) == int));
static assert(typeof(x) == int); // why not work ???
x++;
writeln("x \t", x);
assert(x == 3);
assert(func2() == 2);
}
```
```
dmd ref2.d
ref2.d(19): Error: found ')' when expecting '.' following int
ref2.d(19): Error: found ';' when expecting identifier following 'int.'
ref2.d(21): Error: found 'x' when expecting ')'
ref2.d(21): Error: found '++' when expecting ';'
```
Commit: f47220a30271f91554f2ab6875b39380e7abdb9f
https://github.com/D-Programming-Language/dlang.org/commit/f47220a30271f91554f2ab6875b39380e7abdb9f
Author: Vladimir Panteleev <github.private at thecybershadow.net>
Date: 2016-04-10 (Sun, 10 Apr 2016)
Changed paths:
M spec/declaration.dd
Log Message:
-----------
Merge pull request #1263 from Passw/patch-1
fix compile error
Compare: https://github.com/D-Programming-Language/dlang.org/compare/9d4ba62443d6...f47220a30271
More information about the dlang.org
mailing list