mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 05:30:13 +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
27
compiler/test/fail_compilation/nestedtempl1.d
Normal file
27
compiler/test/fail_compilation/nestedtempl1.d
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
TEST_OUTPUT:
|
||||
---
|
||||
fail_compilation/nestedtempl1.d(14): Deprecation: function `nestedtempl1.main.bar!(a).bar` function requires a dual-context, which is deprecated
|
||||
fail_compilation/nestedtempl1.d(26): instantiated from here: `bar!(a)`
|
||||
fail_compilation/nestedtempl1.d(26): Error: modify `inout` to `mutable` is not allowed inside `inout` function
|
||||
---
|
||||
*/
|
||||
|
||||
auto foo(ref inout(int) x)
|
||||
{
|
||||
struct S
|
||||
{
|
||||
ref inout(int) bar(alias a)() inout
|
||||
{
|
||||
return x;
|
||||
}
|
||||
}
|
||||
return S();
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
int a;
|
||||
auto o = foo(a);
|
||||
o.bar!a() = 1; // bad!
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue