Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dotnet should "@" names conflicting keywords in template #1370

Closed
livarcocc opened this issue Dec 6, 2017 · 1 comment
Closed

Dotnet should "@" names conflicting keywords in template #1370

livarcocc opened this issue Dec 6, 2017 · 1 comment

Comments

@livarcocc
Copy link
Contributor

From @hsorbo on December 6, 2017 20:33

dotnet new may end up creating invalid-code if its folder conflicts with a keyword
Example:

using System;

namespace class
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

Steps to reproduce

mkdir class
cd class
dotnet new console
dotnet build

Expected behavior

compiles

Actual behavior

Program.cs(3,11): error CS1001: Identifier expected [***/class/class.csproj]
Program.cs(3,11): error CS1514: { expected [***/class/class.csproj]
Program.cs(3,16): error CS1001: Identifier expected [***/class/class.csproj]
Program.cs(4,2): error CS1513: } expected [***/class/class.csproj]

Environment data

.NET Command Line Tools (2.0.3)

Product Information:
 Version:            2.0.3
 Commit SHA-1 hash:  eb1d5ee318

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.13
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.0.3/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.3
  Build    : a9190d4a75f4a982ae4b4fa8d1a24526566c69df```







_Copied from original issue: dotnet/cli#8175_
@mlorbetske
Copy link
Contributor

This is being tracked as #381

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants