Skip to content

Compiler Error CS1502 Sample Not working #43993

Closed
@chitangchin

Description

Type of issue

Code doesn't work

Description

Code Sample in .NET Documentation does not produce CS1502 error:

// CS1502.cs  
namespace x  
{  
   public class a  
   {  
      public a(char i)  
      // try the following constructor instead  
      // public a(int i)  
      {  
      }  
  
      public static void Main()  
      {  
         a aa = new a(2222);   // CS1502  
      }  
   }  
}

CS1503 is shown instead.

Page URL

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs1502

Content source URL

https://github.com/dotnet/docs/blob/main/docs/csharp/language-reference/compiler-messages/cs1502.md

Document Version Independent Id

6c2dac12-ba9a-4044-a93e-7cf759735f22

Article author

@BillWagner

Metadata

  • ID: ba03ad71-413b-a1bf-c759-29a575887e72
  • Service: dotnet-csharp
  • Sub-service: errors-warnings

Related Issues

Metadata

Assignees

No one assigned

    Labels

    dotnet-csharp/svcerrors-warnings/subsvcin-prThis issue will be closed (fixed) by an active pull request.okr-qualityContent-quality KR: Concerns article defects (bugs), freshness, or build warnings.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions