Current filter:
                                You should refresh the page.
                                  • Hello, when using "Declare property with initializer" refactoring on constructor parameter, it generates read/write property in readonly struct, which is nonsense.

                                    [C#]
                                    public readonly struct TestStruct { public TestStruct(string name) { Name = name; } public string Name { get; set; } }
                                • George K (DevExpress) 01.09.2019

                                  Hi Karel,
                                  Thanks for the code snippet.
                                  I have reproduced it locally. Please give us some time to research the issue in detail.

                                1 Solution

                                Creation Date Importance Sort by

                                Fixed:

                                Show all comments
                                • Karel Král Scia 02.08.2019

                                  Installed official version 18.2.7 and the problem still persists. I suppose that this has to be related to existing templates on my local drive. Can you direct me how to replace them, if this is the case?

                                • George K (DevExpress) 02.08.2019

                                  Hi Karel,
                                  Do you use Declare Property or Declare Property With Initializer? I reproduced the issue with Declare Property only.
                                  Please give us some time to fix the problem.

                                • Karel Král Scia 02.09.2019

                                  Sorry for misleading comment. You are right, Declare property with initializer is working now. I used declare auto property ("as", "ai" template) on readonly struct and this template generates read-write properties, which is a bug, You should probably create another ticket for this.

                                • Karel Král Scia 02.09.2019

                                  Declare property is also buggy, generates write method on readonly struct.

                                • George K (DevExpress) 02.11.2019

                                  Hi Karel,
                                  I've created a separate ticket on your behalf (T714575: "as", "ai" templates on readonly struct generates read-write properties). It has been placed in our processing queue and will be answered shortly.

                                • Karel Král Scia 02.12.2019

                                  I think you forgot to create a ticket about Declare property which is also mentioned above and is not working in readonly struct also. See screencast.

                                • George K (DevExpress) 02.12.2019

                                  Hi Karel,
                                  Thank you for the screencast. This issue will be fixed in the context of this ticket.

                                • George K (DevExpress) 02.12.2019

                                  Hi Karel,
                                  We have just fixed this issue. You can download a hotfix from this link.