Skip to content

Commit

Permalink
Merge pull request #17900 from AlekseyTs/DefaultInterfaceImplementation
Browse files Browse the repository at this point in the history
FI from master to features/DefaultInterfaceImplementation
  • Loading branch information
AlekseyTs authored Mar 16, 2017
2 parents e42c79e + 4b6bb0c commit d5d698b
Show file tree
Hide file tree
Showing 150 changed files with 3,313 additions and 2,871 deletions.
1 change: 1 addition & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<add key="dotnet.myget.org dotnet-buildtools" value="https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json" />
<add key="dotnet.myget.org symreader" value="https://dotnet.myget.org/F/symreader/api/v3/index.json" />
<add key="dotnet.myget.org symreader-portable" value="https://dotnet.myget.org/F/symreader-portable/api/v3/index.json" />
<add key="dotnet.myget.org symreader-converter" value="https://dotnet.myget.org/F/symreader-converter/api/v3/index.json" />
<add key="dotnet.myget.org interactive-window" value="https://dotnet.myget.org/F/interactive-window/api/v3/index.json" />
<add key="dotnet.myget.org roslyn-master-nightly" value="https://dotnet.myget.org/F/roslyn-master-nightly/api/v3/index.json" />
<add key="dotnet.myget.org devcore" value="https://www.myget.org/F/vs-devcore/api/v3/index.json" />
Expand Down
9 changes: 1 addition & 8 deletions Roslyn.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.25920.0
VisualStudioVersion = 15.0.26228.4
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeAnalysisTest", "src\Compilers\Core\CodeAnalysisTest\CodeAnalysisTest.csproj", "{A4C99B85-765C-4C65-9C2A-BB609AAB09E6}"
EndProject
Expand Down Expand Up @@ -235,8 +235,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResultProvider.Portable", "
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vbc", "src\Compilers\VisualBasic\vbc\vbc.csproj", "{E58EE9D7-1239-4961-A0C1-F9EC3952C4C1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pdb2Xml", "src\Tools\Source\Pdb2Xml\Pdb2Xml.csproj", "{CF450DCE-D12B-4A11-8D2D-A7A125372C48}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Setup", "Setup", "{19148439-436F-4CDA-B493-70AF4FFC13E9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Features", "Features", "{2491A9B9-C0A8-49EE-9077-A32DE76E1E94}"
Expand Down Expand Up @@ -792,10 +790,6 @@ Global
{E58EE9D7-1239-4961-A0C1-F9EC3952C4C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E58EE9D7-1239-4961-A0C1-F9EC3952C4C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E58EE9D7-1239-4961-A0C1-F9EC3952C4C1}.Release|Any CPU.Build.0 = Release|Any CPU
{CF450DCE-D12B-4A11-8D2D-A7A125372C48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CF450DCE-D12B-4A11-8D2D-A7A125372C48}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CF450DCE-D12B-4A11-8D2D-A7A125372C48}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CF450DCE-D12B-4A11-8D2D-A7A125372C48}.Release|Any CPU.Build.0 = Release|Any CPU
{E3CD2895-76A8-4D11-A316-EA67CB5EA42C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E3CD2895-76A8-4D11-A316-EA67CB5EA42C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E3CD2895-76A8-4D11-A316-EA67CB5EA42C}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -1096,7 +1090,6 @@ Global
{BEDC5A4A-809E-4017-9CFD-6C8D4E1847F0} = {998CAFE8-06E4-4683-A151-0F6AA4BFF6C6}
{FA0E905D-EC46-466D-B7B2-3B5557F9428C} = {998CAFE8-06E4-4683-A151-0F6AA4BFF6C6}
{E58EE9D7-1239-4961-A0C1-F9EC3952C4C1} = {C65C6143-BED3-46E6-869E-9F0BE6E84C37}
{CF450DCE-D12B-4A11-8D2D-A7A125372C48} = {64BDF58B-41BA-A19E-0D34-B5FA598403B6}
{19148439-436F-4CDA-B493-70AF4FFC13E9} = {999FBDA2-33DA-4F74-B957-03AC72CCE5EC}
{2491A9B9-C0A8-49EE-9077-A32DE76E1E94} = {999FBDA2-33DA-4F74-B957-03AC72CCE5EC}
{5CA5F70E-0FDB-467B-B22C-3CD5994F0087} = {999FBDA2-33DA-4F74-B957-03AC72CCE5EC}
Expand Down
1 change: 1 addition & 0 deletions build/Targets/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<MicrosoftDiagnosticsRuntimeVersion>0.8.31-beta</MicrosoftDiagnosticsRuntimeVersion>
<MicrosoftDiagnosticsTracingTraceEventVersion>1.0.35</MicrosoftDiagnosticsTracingTraceEventVersion>
<MicrosoftDiaSymReaderVersion>1.1.0</MicrosoftDiaSymReaderVersion>
<MicrosoftDiaSymReaderConverterXmlVersion>1.0.0-beta1-61515-01</MicrosoftDiaSymReaderConverterXmlVersion>
<MicrosoftDiaSymReaderNativeVersion>1.5.0</MicrosoftDiaSymReaderNativeVersion>
<MicrosoftDiaSymReaderPortablePdbVersion>1.2.0</MicrosoftDiaSymReaderPortablePdbVersion>
<MicrosoftNETCoreRuntimeCoreCLRVersion>1.1.0</MicrosoftNETCoreRuntimeCoreCLRVersion>
Expand Down
1 change: 0 additions & 1 deletion build/config/SignToolData.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"Exes\\vbccore\\vbc.exe",
"Exes\\vbi\\vbi.exe",
"Exes\\vbicore\\vbi.exe",
"Exes\\Pdb2Xml\\Pdb2Xml.exe",
"Vsix\\CompilerExtension\\Roslyn.Compilers.Extension.dll",
"Vsix\\Templates\\Roslyn.Templates.dll",
"Vsix\\VisualStudioDiagnosticsWindow\\Roslyn.VisualStudio.DiagnosticsWindow.dll",
Expand Down
14 changes: 9 additions & 5 deletions build/scripts/cibuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,16 @@ try {
Run-MSBuild Roslyn.sln /p:Configuration=$buildConfiguration /p:DeployExtension=false

# Check if we have credentials to upload to benchview
if ((Test-Path env:\GIT_BRANCH) -and (Test-Path BV_UPLOAD_SAS_TOKEN)) {
$extraArgs="--report-benchview --branch $(env:GIT_BRANCH)"
$extraArgs = ""
if ((Test-Path env:\GIT_BRANCH) -and (Test-Path env:\BV_UPLOAD_SAS_TOKEN)) {
$extraArgs = "--report-benchview --branch $($env:GIT_BRANCH)"

# Check if we are in a PR or this is a rolling submission
if (Test-Path env:\ghprbPullTitle) {
$extraArgs='$($extraArgs) --benchview-submission-name "[$($env:ghprbPullAuthorLogin)] PR $($env:ghprbPullId): $($env:ghprbPullTitle)" --benchview-submission-type private'
$extraArgs = '$($extraArgs) --benchview-submission-name "[$($env:ghprbPullAuthorLogin)] PR $($env:ghprbPullId): $($env:ghprbPullTitle)" --benchview-submission-type private'
}
else {
$extraArgs='$(4extraArgs) --benchview-submission-type rolling'
$extraArgs = '$(4extraArgs) --benchview-submission-type rolling'
}

Create-Directory ".\Binaries\$buildConfiguration\tools\"
Expand All @@ -121,7 +122,10 @@ try {
}

Terminate-BuildProcesses
Exec { & ".\Binaries\$buildConfiguration\Exes\Perf.Runner\Roslyn.Test.Performance.Runner.exe" --search-directory=".\\Binaries\\$buildConfiguration\\Dlls\\" --no-trace-upload $extraArgs }
& ".\Binaries\$buildConfiguration\Exes\Perf.Runner\Roslyn.Test.Performance.Runner.exe" --search-directory=".\\Binaries\\$buildConfiguration\\Dlls\\" --no-trace-upload $extraArgs
if (-not $?) {
throw "Perf run failed"
}
exit 0
}

Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/Binder/Binder_Symbols.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2079,7 +2079,7 @@ internal static void CheckFeatureAvailability(SyntaxNode syntax, MessageID featu
LanguageVersion requiredVersion = feature.RequiredVersion();
if (requiredVersion > availableVersion)
{
diagnostics.Add(availableVersion.GetErrorCode(), location, feature.Localize(), requiredVersion.Localize());
diagnostics.Add(availableVersion.GetErrorCode(), location, feature.Localize(), new CSharpRequiredLanguageVersion(requiredVersion));
}
}
}
Expand Down
115 changes: 43 additions & 72 deletions src/Compilers/CSharp/Portable/CSharpParseOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,90 +50,46 @@ public CSharpParseOptions(
IEnumerable<string> preprocessorSymbols = null)
: this(languageVersion,
documentationMode,
kind,
preprocessorSymbols.ToImmutableArrayOrEmpty(),
kind,
preprocessorSymbols.ToImmutableArrayOrEmpty(),
ImmutableDictionary<string, string>.Empty)
{
// We test the mapped value, LanguageVersion, rather than the parameter, languageVersion,
// which has not had "Latest" mapped to the latest version yet.
if (!LanguageVersion.IsValid())
{
throw new ArgumentOutOfRangeException(nameof(languageVersion));
}

if (!kind.IsValid())
{
throw new ArgumentOutOfRangeException(nameof(kind));
}

if (preprocessorSymbols != null)
{
foreach (var preprocessorSymbol in preprocessorSymbols)
{
if (!SyntaxFacts.IsValidIdentifier(preprocessorSymbol))
{
throw new ArgumentException($"{nameof(preprocessorSymbols)} contains a symbol that is not a valid identifier", nameof(preprocessorSymbols));
}
}
}
}

internal CSharpParseOptions(
LanguageVersion languageVersion,
DocumentationMode documentationMode,
SourceCodeKind kind,
IEnumerable<string> preprocessorSymbols,
ImmutableDictionary<string, string> features)
: this(languageVersion, documentationMode, kind, preprocessorSymbols)
IReadOnlyDictionary<string, string> features)
: base(kind, documentationMode)
{
if (features == null)
{
throw new ArgumentNullException(nameof(features));
}

_features = features;
this.SpecifiedLanguageVersion = languageVersion;
this.LanguageVersion = languageVersion.MapSpecifiedToEffectiveVersion();
this.PreprocessorSymbols = preprocessorSymbols.ToImmutableArrayOrEmpty();
_features = features?.ToImmutableDictionary() ?? ImmutableDictionary<string, string>.Empty;
}

private CSharpParseOptions(CSharpParseOptions other) : this(
languageVersion: other.SpecifiedLanguageVersion,
documentationMode: other.DocumentationMode,
kind: other.Kind,
preprocessorSymbols: other.PreprocessorSymbols,
features: other.Features.ToImmutableDictionary())
{
}

// No validation
private CSharpParseOptions(
LanguageVersion languageVersion,
DocumentationMode documentationMode,
SourceCodeKind kind,
ImmutableArray<string> preprocessorSymbols,
ImmutableDictionary<string, string> features)
: base(kind, documentationMode)
features: other.Features)
{
Debug.Assert(!preprocessorSymbols.IsDefault);
this.SpecifiedLanguageVersion = languageVersion;
this.LanguageVersion = languageVersion.MapSpecifiedToEffectiveVersion();
this.PreprocessorSymbols = preprocessorSymbols;
_features = features;
}

public override string Language => LanguageNames.CSharp;

public new CSharpParseOptions WithKind(SourceCodeKind kind)
{
if (kind == this.Kind)
if (kind == this.SpecifiedKind)
{
return this;
}

if (!kind.IsValid())
{
throw new ArgumentOutOfRangeException(nameof(kind));
}

return new CSharpParseOptions(this) { Kind = kind };
var effectiveKind = kind.MapSpecifiedToEffectiveKind();
return new CSharpParseOptions(this) { SpecifiedKind = kind, Kind = effectiveKind };
}

public CSharpParseOptions WithLanguageVersion(LanguageVersion version)
Expand All @@ -144,11 +100,6 @@ public CSharpParseOptions WithLanguageVersion(LanguageVersion version)
}

var effectiveLanguageVersion = version.MapSpecifiedToEffectiveVersion();
if (!effectiveLanguageVersion.IsValid())
{
throw new ArgumentOutOfRangeException(nameof(version));
}

return new CSharpParseOptions(this) { SpecifiedLanguageVersion = version, LanguageVersion = effectiveLanguageVersion };
}

Expand Down Expand Up @@ -184,11 +135,6 @@ public CSharpParseOptions WithPreprocessorSymbols(ImmutableArray<string> symbols
return this;
}

if (!documentationMode.IsValid())
{
throw new ArgumentOutOfRangeException(nameof(documentationMode));
}

return new CSharpParseOptions(this) { DocumentationMode = documentationMode };
}

Expand All @@ -212,12 +158,11 @@ protected override ParseOptions CommonWithFeatures(IEnumerable<KeyValuePair<stri
/// </summary>
public new CSharpParseOptions WithFeatures(IEnumerable<KeyValuePair<string, string>> features)
{
if (features == null)
{
throw new ArgumentNullException(nameof(features));
}
ImmutableDictionary<string, string> dictionary =
features?.ToImmutableDictionary(StringComparer.OrdinalIgnoreCase)
?? ImmutableDictionary<string, string>.Empty;

return new CSharpParseOptions(this) { _features = features.ToImmutableDictionary(StringComparer.OrdinalIgnoreCase) };
return new CSharpParseOptions(this) { _features = dictionary };
}

public override IReadOnlyDictionary<string, string> Features
Expand All @@ -228,6 +173,32 @@ public override IReadOnlyDictionary<string, string> Features
}
}

internal override void ValidateOptions(ArrayBuilder<Diagnostic> builder)
{
ValidateOptions(builder, MessageProvider.Instance);

// Validate LanguageVersion not SpecifiedLanguageVersion, after Latest/Default has been converted:
if (!LanguageVersion.IsValid())
{
builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_BadLanguageVersion, LanguageVersion.ToString()));
}

if (!PreprocessorSymbols.IsDefaultOrEmpty)
{
foreach (var symbol in PreprocessorSymbols)
{
if (symbol == null)
{
builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_InvalidPreprocessingSymbol, "null"));
}
else if (!SyntaxFacts.IsValidIdentifier(symbol))
{
builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_InvalidPreprocessingSymbol, symbol));
}
}
}
}

internal bool IsFeatureEnabled(MessageID feature)
{
string featureFlag = feature.RequiredFeature();
Expand Down
51 changes: 48 additions & 3 deletions src/Compilers/CSharp/Portable/CSharpResources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d5d698b

Please sign in to comment.