This is a soft fork of Roslyn. It is primarily serves as a sandbox for testing out ideas for C#. All changes to the language are locked behind feature flags, meaning you can opt into them individually. (In theory anwyay, the way Roslyn is designed means mistakes could break expecations here.)
There is a quick-and-dirty NuGet package attached to this release. If you just want to see the fork in action, check out PathogenPlayground/CSharpParameterlessStruct/patholyn-demo.
The intent is that eventually you'll be able to consume this compiler as a NuGet package and eventually we'll automatically keep pace with the Roslyn upstream using CI.
This feature is similar to dotnet/csharplang#99
This feature flag enables parameterless instance constructors on structs, for example:
public struct MyStruct
{
private string Message;
public MyStruct()
=> Message = "Initialized from parameterless constructor.";
public MyStruct(string message)
=> Message = message;
public override string ToString()
=> Message ?? "Defaulted struct.";
}The implementation of this feature is based on the cut C# 6 feature that was removed before Roslyn 1.0 was released.
(Note that the Visual Basic implementation of this feature was not restored.)
Roslyn actually supports calling parameterless constructors on structs when they exist. So using this feature on public API does not make it incompatible with vanilla Roslyn. Parameterless constructors will be called as expected.
Past this point is the original Roslyn readme, unmodified.
Roslyn provides open-source C# and Visual Basic compilers with rich code analysis APIs. It enables building code analysis tools with the same APIs that are used by Visual Studio.
If you want to suggest a new feature for the C# or Visual Basic languages go here:
- dotnet/csharplang for C# specific issues
- dotnet/vblang for VB-specific features
- dotnet/csharplang for features that affect both languages
Some of the best ways to contribute are to try things out, file bugs, and join in design conversations.
A great way to get started is to ask some questions!
- Start with a question on discussions
- You can also join in on the design discussions on gitter or discord
- First read this guide: How to Contribute
- Building, testing and debugging the sources
- Top Bugs
If you want to get started using Roslyn's APIs to analyzer your code take a look at these links:
- Roslyn Architecture Overview
- Tutorial: Write your first analyzer and code fix
- Useful Tools
- Syntax Visualizer Tool
- Syntax Quoter Tool
- Browse the source with the enhanced source view
The latest pre-release builds are available from the following public NuGet feeds:
- Compiler:
https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json - IDE Services:
https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json - .NET SDK:
https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json
| Branch | Debug x86 | Debug x64 | Release x86 | Release x64 |
|---|---|---|---|---|
| master | ||||
| master-vs-deps |
| Branch | Windows Debug | Windows Release | Linux |
|---|---|---|---|
| master | |||
| master-vs-deps |
| Branch | Debug | Release |
|---|---|---|
| master | ||
| master-vs-deps |
| Branch | Determinism | Build Correctness | Spanish | Mono |
|---|---|---|---|---|
| master | ||||
| master-vs-deps |
This project has adopted the .NET Foundation Code of Conduct.
This project is part of the .NET Foundation along with other projects like the .NET Runtime.
