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

RSRP-469306: Replace Anonymous Type: class name with dots considered valid.

$
0
0
Reporter Lilia Shamsutdinova (Lilia.Shamsutdinova) Lilia Shamsutdinova (Lilia.Shamsutdinova)
Created Apr 18, 2018 12:03:02 PM
Updated Apr 18, 2018 12:03:02 PM
Subsystem Refactorings
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Bug
Fix version Backlog
Affected versions 2018.2, 2018.1
Fixed In Version ReSharper Undefined
VsVersion All Versions

JetBrains ReSharper Ultimate 182.0.20180416.132916-eap00d.

    internal class Book
    {
        public string Author { get; set; }
        public string Title { get; set; }
    }

    public class ConvertAnonymousToNamedType
    {
        private string Test(List<Book> books)
        {
            var bookList = from book in books
                select new { book.Author, book.Title };

            var bookNew = bookList.ToList().FirstOrDefault(book => book.Author == "King");
            return bookNew?.Author;
        }
    }
  1. Invoke Refactor This -> Replace Anonymous Type With Named Class on new in new { book.Author, book.Title }.
  2. Set "T.T" as Name.

Actual result:
No error message. Name considered valid.

Expected result:
"Identifier is not valid" error message is shown.

NOTE:
If proceed with name "T.T" then class "T" is created.


Viewing all articles
Browse latest Browse all 106942

Trending Articles



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