mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 13:40:11 +03:00
Trivial: Merge two similar tests around default arguments
This commit is contained in:
parent
5c9901f09c
commit
cdf48260d8
2 changed files with 4 additions and 10 deletions
|
@ -1,4 +1,3 @@
|
||||||
// REQUIRED_ARGS: -de
|
|
||||||
/*
|
/*
|
||||||
TEST_OUTPUT:
|
TEST_OUTPUT:
|
||||||
---
|
---
|
||||||
|
@ -8,6 +7,7 @@ fail_compilation/diag3438.d(20): Error: constructor `diag3438.F5.this` is marked
|
||||||
fail_compilation/diag3438.d(20): Use `@disable this();` if you want to disable default initialization.
|
fail_compilation/diag3438.d(20): Use `@disable this();` if you want to disable default initialization.
|
||||||
fail_compilation/diag3438.d(21): Error: constructor `diag3438.F6.this` is marked `@disable`, so it cannot have default arguments for all parameters.
|
fail_compilation/diag3438.d(21): Error: constructor `diag3438.F6.this` is marked `@disable`, so it cannot have default arguments for all parameters.
|
||||||
fail_compilation/diag3438.d(21): Use `@disable this();` if you want to disable default initialization.
|
fail_compilation/diag3438.d(21): Use `@disable this();` if you want to disable default initialization.
|
||||||
|
fail_compilation/diag3438.d(24): Error: default argument expected for `y`
|
||||||
---
|
---
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -19,3 +19,6 @@ struct F3 { this(...) { } } // ok
|
||||||
struct F4 { this(int[] x...) { } } // ok
|
struct F4 { this(int[] x...) { } } // ok
|
||||||
struct F5 { @disable this(int x = 1); }
|
struct F5 { @disable this(int x = 1); }
|
||||||
struct F6 { @disable this(int x = 1) { } }
|
struct F6 { @disable this(int x = 1) { } }
|
||||||
|
|
||||||
|
// Make sure the deprecation doesn't interfere w/ the check for default arguments
|
||||||
|
struct S { this(int x = 1, int y) { } }
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
/*
|
|
||||||
TEST_OUTPUT:
|
|
||||||
---
|
|
||||||
fail_compilation/diag3438b.d(9): Error: default argument expected for `y`
|
|
||||||
---
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Make sure the deprecation doesn't interfere w/ the check for default arguments
|
|
||||||
struct S { this(int x = 1, int y) { } }
|
|
Loading…
Add table
Add a link
Reference in a new issue