mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
Fix error when struct initializer isn't accepted (#21086)
* Fix error when struct initializer isn't accepted * Rename StructDeclaration.hasRegularCtor parameter to ignoreDisabled checkDisabled detected disabled ctors when it was false, which was confusing! * Update tests
This commit is contained in:
parent
3142290b6f
commit
13b0745e33
6 changed files with 16 additions and 11 deletions
|
@ -3,8 +3,10 @@
|
|||
/*
|
||||
TEST_OUTPUT:
|
||||
---
|
||||
fail_compilation/fail21547.d(32): Error: struct `Bar` has constructors, cannot use `{ initializers }`, use `Bar( initializers )` instead
|
||||
fail_compilation/fail21547.d(33): Error: struct `Bar1` has constructors, cannot use `{ initializers }`, use `Bar1( initializers )` instead
|
||||
fail_compilation/fail21547.d(34): Error: Cannot use struct initializer syntax for struct `Bar` because it has a constructor
|
||||
fail_compilation/fail21547.d(34): Use `Bar( arguments )` instead of `{ initializers }`
|
||||
fail_compilation/fail21547.d(35): Error: Cannot use struct initializer syntax for struct `Bar1` because it has a constructor
|
||||
fail_compilation/fail21547.d(35): Use `Bar1( arguments )` instead of `{ initializers }`
|
||||
---
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/*
|
||||
TEST_OUTPUT:
|
||||
---
|
||||
fail_compilation/fail336.d(16): Error: struct `S` has constructors, cannot use `{ initializers }`, use `S( initializers )` instead
|
||||
fail_compilation/fail336.d(17): Error: Cannot use struct initializer syntax for struct `S` because it has a constructor
|
||||
fail_compilation/fail336.d(17): Use `S( arguments )` instead of `{ initializers }`
|
||||
---
|
||||
*/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue