Trivial: Merge two similar tests around default arguments

This commit is contained in:
Geod24 2022-08-29 08:24:44 +02:00
parent 5c9901f09c
commit cdf48260d8
2 changed files with 4 additions and 10 deletions

View file

@ -1,4 +1,3 @@
// REQUIRED_ARGS: -de
/*
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(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(24): Error: default argument expected for `y`
---
*/
@ -19,3 +19,6 @@ struct F3 { this(...) { } } // ok
struct F4 { this(int[] x...) { } } // ok
struct F5 { @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) { } }

View file

@ -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) { } }