Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-469417: Initialize field from constructor: Uncompilable code is generated for field with name '@operator'.

$
0
0
Reporter Lilia Shamsutdinova (Lilia.Shamsutdinova) Lilia Shamsutdinova (Lilia.Shamsutdinova)
Created Apr 26, 2018 2:43:19 PM
Updated Apr 26, 2018 3:22:25 PM
Subsystem Quick Fixes
Assignee Andrew Karpov (andrew.karpov)
Priority Major
State Submitted
Type Bug
Fix version Backlog
Affected versions 2018.1
Fixed In Version ReSharper Undefined
VsVersion All Versions

JetBrains ReSharper Ultimate 2018.1.1 12.0.20180425.220038-eap01d.

    public class Buggy
    {
        private readonly string @operator;
        private readonly int value;

        public Buggy(int value, string @operator)
        {
        }
    }
  1. Invoke "Initialize field from constructor" QF on @operator.

Actual result:
Uncompilable code:

    public class Buggy
    {
        private readonly string @operator;
        private readonly int value;

        public Buggy(int value, string @operator, string @operator)
        {
            this.@operator = @operator;
        }
    }

Expected result:
Compilable code.

NOTE:
The same behavior applies for @void BUT in case of @int new parameter with name i is created:

        public Buggy(int value, string @int, string i)
        {
            this.@int = i;
        }

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>