mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
Move dmd files into compiler/
This commit is contained in:
parent
20bd0cacbd
commit
6374bb87b7
4579 changed files with 4 additions and 4 deletions
22
compiler/test/fail_compilation/scope_class.d
Normal file
22
compiler/test/fail_compilation/scope_class.d
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
TEST_OUTPUT:
|
||||
---
|
||||
fail_compilation/scope_class.d(10): Deprecation: `scope` as a type constraint is deprecated. Use `scope` at the usage site.
|
||||
fail_compilation/scope_class.d(12): Error: functions cannot return `scope scope_class.C`
|
||||
---
|
||||
*/
|
||||
|
||||
|
||||
scope class C { int i; } // Notice the use of `scope` here
|
||||
|
||||
C increment(C c)
|
||||
{
|
||||
c.i++;
|
||||
return c;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
scope C c = new C();
|
||||
c.increment();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue