Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
H. S. Teoh
committed
Jul 14, 2014
1 parent
d615255
commit 311937f
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/fail13116.d(13): Error: this is not an lvalue | ||
--- | ||
*/ | ||
struct S | ||
{ | ||
ref S notEvil() { return this; } // this should be accepted | ||
} | ||
class C | ||
{ | ||
ref C evil() { return this; } // this should be rejected | ||
} | ||
void main() | ||
{ | ||
} | ||
|
||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/fail13116.d(28): Error: super is not an lvalue | ||
--- | ||
*/ | ||
class Base { } | ||
class Derived : Base | ||
{ | ||
ref Base evil() { return super; } // should be rejected | ||
} |