提交 3f0c0a83 编写于 作者: T Ty Overby

Merge pull request #9272 from vslsnap/merge-stabilization-into-master20160227-160016

Merge stabilization into master
SHELL = /usr/bin/env bash
OS_NAME = $(shell uname -s)
NUGET_PACKAGE_NAME = nuget.58
NUGET_PACKAGE_NAME = nuget.59
BUILD_CONFIGURATION = Debug
BOOTSTRAP_PATH = $(shell pwd)/Binaries/Bootstrap
BUILD_LOG_PATH =
......
......@@ -5,7 +5,7 @@
<SystemCollectionsImmutableAssemblyVersion Condition="'$(SystemCollectionsImmutableAssemblyVersion)' == ''">1.1.37</SystemCollectionsImmutableAssemblyVersion>
<NuGetCommandLineAssemblyVersion Condition="'$(NuGetCommandLineAssemblyVersion)' == ''">2.8.5</NuGetCommandLineAssemblyVersion>
<MicrosoftCompositionAssemblyVersion Condition="'$(MicrosoftCompositionAssemblyVersion)' == ''">1.0.27</MicrosoftCompositionAssemblyVersion>
<SystemReflectionMetadataVersion>$(SystemReflectionMetadataAssemblyVersion)-rc3-23811</SystemReflectionMetadataVersion>
<SystemReflectionMetadataVersion>$(SystemReflectionMetadataAssemblyVersion)-rc2-23826</SystemReflectionMetadataVersion>
<SystemCollectionsImmutableVersion>$(SystemCollectionsImmutableAssemblyVersion)</SystemCollectionsImmutableVersion>
<MicrosoftDiaSymReaderNativeVersion>1.3.3</MicrosoftDiaSymReaderNativeVersion>
<NuGetCommandLineVersion>$(NuGetCommandLineAssemblyVersion)</NuGetCommandLineVersion>
......
......@@ -705,7 +705,7 @@ Semantics.ConversionKind IConversionExpression.ConversionKind
return Semantics.ConversionKind.CSharp;
default:
throw ExceptionUtilities.UnexpectedValue(this.ConversionKind);
return Semantics.ConversionKind.Invalid;
}
}
}
......
......@@ -520,6 +520,8 @@ protected override CompilationOptions CommonWithFeatures(ImmutableArray<string>
internal override void ValidateOptions(ArrayBuilder<Diagnostic> builder)
{
ValidateOptions(builder, MessageProvider.Instance);
// /main & /target:{library|netmodule|winmdobj}
if (this.MainTypeName != null)
{
......@@ -581,24 +583,6 @@ internal override void ValidateOptions(ArrayBuilder<Diagnostic> builder)
// TODO: add check for
// (kind == 'arm' || kind == 'appcontainer' || kind == 'winmdobj') &&
// (version >= "6.2")
if (!CryptoPublicKey.IsEmpty)
{
if (CryptoKeyFile != null)
{
builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_MutuallyExclusiveOptions, nameof(CryptoPublicKey), nameof(CryptoKeyFile)));
}
if (CryptoKeyContainer != null)
{
builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_MutuallyExclusiveOptions, nameof(CryptoPublicKey), nameof(CryptoKeyContainer)));
}
}
if (PublicSign && DelaySign == true)
{
builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_MutuallyExclusiveOptions, nameof(PublicSign), nameof(DelaySign)));
}
}
public bool Equals(CSharpCompilationOptions other)
......
......@@ -4675,4 +4675,7 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<data name="ERR_TooManyUserStrings" xml:space="preserve">
<value>Combined length of user strings used by the program exceeds allowed limit. Try to decrease use of string literals.</value>
</data>
</root>
\ No newline at end of file
<data name="ERR_PeWritingFailure" xml:space="preserve">
<value>An error occurred while writing the output file.</value>
</data>
</root>
......@@ -1118,6 +1118,12 @@ public new CSharpCommandLineArguments Parse(IEnumerable<string> args, string bas
keyFileSearchPaths.Add(outputDirectory);
}
// Public sign doesn't use the legacy search path settings
if (publicSign && !string.IsNullOrWhiteSpace(keyFileSetting))
{
keyFileSetting = ParseGenericPathToFile(keyFileSetting, diagnostics, baseDirectory);
}
var parsedFeatures = CompilerOptionParseUtilities.ParseFeatures(features);
string compilationName;
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
using Microsoft.CodeAnalysis.CodeGen;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE;
using Microsoft.CodeAnalysis.Emit;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp.Emit
{
......@@ -36,6 +33,8 @@ internal sealed partial class CSharpDefinitionMap : DefinitionMap<CSharpSymbolMa
_metadataDecoder = metadataDecoder;
}
internal override CommonMessageProvider MessageProvider => CSharp.MessageProvider.Instance;
internal bool TryGetAnonymousTypeName(NamedTypeSymbol template, out string name, out int index)
{
return this.mapToPrevious.TryGetAnonymousTypeName(template, out name, out index);
......
......@@ -402,15 +402,10 @@ public override Symbol VisitAssembly(AssemblySymbol symbol)
return _otherAssembly;
}
// find a referenced assembly with the exactly same source identity:
// find a referenced assembly with the exactly same identity:
foreach (var otherReferencedAssembly in _otherAssembly.Modules[0].ReferencedAssemblySymbols)
{
var identity = symbol.Identity;
var otherIdentity = otherReferencedAssembly.Identity;
if (AssemblyIdentityComparer.SimpleNameComparer.Equals(identity.Name, otherIdentity.Name) &&
(symbol.AssemblyVersionPattern ?? symbol.Identity.Version).Equals(otherReferencedAssembly.AssemblyVersionPattern ?? otherReferencedAssembly.Identity.Version) &&
AssemblyIdentity.EqualIgnoringNameAndVersion(identity, otherIdentity))
if (symbol.Identity.Equals(otherReferencedAssembly.Identity))
{
return otherReferencedAssembly;
}
......
......@@ -35,7 +35,7 @@ internal static class EmitHelpers
}
catch (BadImageFormatException)
{
// TODO (https://github.com/dotnet/roslyn/issues/8910):
// TODO:
// return MakeEmitResult(success: false, diagnostics: ..., baseline: null);
throw;
}
......@@ -47,25 +47,15 @@ internal static class EmitHelpers
var serializationProperties = compilation.ConstructModuleSerializationProperties(emitOptions, runtimeMDVersion, moduleVersionId);
var manifestResources = SpecializedCollections.EmptyEnumerable<ResourceDescription>();
PEDeltaAssemblyBuilder moduleBeingBuilt;
try
{
moduleBeingBuilt = new PEDeltaAssemblyBuilder(
compilation.SourceAssembly,
emitOptions: emitOptions,
outputKind: compilation.Options.OutputKind,
serializationProperties: serializationProperties,
manifestResources: manifestResources,
previousGeneration: baseline,
edits: edits,
isAddedSymbol: isAddedSymbol);
}
catch (NotSupportedException)
{
// TODO: better error code (https://github.com/dotnet/roslyn/issues/8910)
diagnostics.Add(ErrorCode.ERR_ModuleEmitFailure, NoLocation.Singleton, compilation.AssemblyName);
return new EmitDifferenceResult(success: false, diagnostics: diagnostics.ToReadOnlyAndFree(), baseline: null);
}
var moduleBeingBuilt = new PEDeltaAssemblyBuilder(
compilation.SourceAssembly,
emitOptions: emitOptions,
outputKind: compilation.Options.OutputKind,
serializationProperties: serializationProperties,
manifestResources: manifestResources,
previousGeneration: baseline,
edits: edits,
isAddedSymbol: isAddedSymbol);
if (testData != null)
{
......
......@@ -102,11 +102,10 @@ private EmitBaseline.MetadataSymbols GetOrCreateMetadataSymbols(EmitBaseline ini
// We need to transfer the references from the current source compilation but don't need its syntax trees.
var metadataCompilation = compilation.RemoveAllSyntaxTrees();
ImmutableDictionary<AssemblyIdentity, AssemblyIdentity> assemblyReferenceIdentityMap;
var metadataAssembly = metadataCompilation.GetBoundReferenceManager().CreatePEAssemblyForAssemblyMetadata(AssemblyMetadata.Create(originalMetadata), MetadataImportOptions.All, out assemblyReferenceIdentityMap);
var metadataAssembly = metadataCompilation.GetBoundReferenceManager().CreatePEAssemblyForAssemblyMetadata(AssemblyMetadata.Create(originalMetadata), MetadataImportOptions.All);
var metadataDecoder = new MetadataDecoder(metadataAssembly.PrimaryModule);
var metadataAnonymousTypes = GetAnonymousTypeMapFromMetadata(originalMetadata.MetadataReader, metadataDecoder);
var metadataSymbols = new EmitBaseline.MetadataSymbols(metadataAnonymousTypes, metadataDecoder, assemblyReferenceIdentityMap);
var metadataSymbols = new EmitBaseline.MetadataSymbols(metadataAnonymousTypes, metadataDecoder);
return InterlockedOperations.Initialize(ref initialBaseline.LazyMetadataSymbols, metadataSymbols);
}
......
......@@ -22,7 +22,6 @@ internal AssemblyReference(AssemblySymbol assemblySymbol)
}
public AssemblyIdentity Identity => _targetAssembly.Identity;
public Version AssemblyVersionPattern => _targetAssembly.AssemblyVersionPattern;
public override string ToString()
{
......
......@@ -162,7 +162,6 @@ protected override void AddEmbeddedResourcesFromAddedModules(ArrayBuilder<Cci.Ma
}
AssemblyIdentity Cci.IAssemblyReference.Identity => _sourceAssembly.Identity;
Version Cci.IAssemblyReference.AssemblyVersionPattern => _sourceAssembly.AssemblyVersionPattern;
internal override string Name
{
......
......@@ -1320,5 +1320,6 @@ internal enum ErrorCode
ERR_InvalidPathMap = 8101,
ERR_PublicSignButNoKey = 8102,
ERR_TooManyUserStrings = 8103,
ERR_PeWritingFailure = 8104,
}
}
......@@ -143,6 +143,7 @@ public override ReportDiagnostic GetDiagnosticReport(DiagnosticInfo diagnosticIn
// compilation options:
public override int ERR_BadCompilationOptionValue { get { return (int)ErrorCode.ERR_BadCompilationOptionValue; } }
public override int ERR_MutuallyExclusiveOptions => (int)ErrorCode.ERR_MutuallyExclusiveOptions;
// emit options:
public override int ERR_InvalidDebugInformationFormat { get { return (int)ErrorCode.ERR_InvalidDebugInformationFormat; } }
......@@ -202,6 +203,8 @@ public override void ReportDuplicateMetadataReferenceWeak(DiagnosticBag diagnost
public override int ERR_MetadataNameTooLong { get { return (int)ErrorCode.ERR_MetadataNameTooLong; } }
public override int ERR_EncReferenceToAddedMember { get { return (int)ErrorCode.ERR_EncReferenceToAddedMember; } }
public override int ERR_TooManyUserStrings { get { return (int)ErrorCode.ERR_TooManyUserStrings; } }
public override int ERR_PeWritingFailure { get { return (int)ErrorCode.ERR_PeWritingFailure; } }
public override int ERR_ModuleEmitFailure { get { return (int)ErrorCode.ERR_ModuleEmitFailure; } }
public override void ReportInvalidAttributeArgument(DiagnosticBag diagnostics, SyntaxNode attributeSyntax, int parameterIndex, AttributeData attribute)
{
......
......@@ -96,7 +96,7 @@ private FieldSymbol GetAwaiterField(TypeSymbol awaiterType)
if (!_awaiterFields.TryGetValue(awaiterType, out result))
{
int slotIndex;
if (slotAllocatorOpt == null || !slotAllocatorOpt.TryGetPreviousAwaiterSlotIndex(F.ModuleBuilderOpt.Translate(awaiterType, F.Syntax, F.Diagnostics), out slotIndex))
if (slotAllocatorOpt == null || !slotAllocatorOpt.TryGetPreviousAwaiterSlotIndex(F.ModuleBuilderOpt.Translate(awaiterType, F.Syntax, F.Diagnostics), F.Diagnostics, out slotIndex))
{
slotIndex = _nextAwaiterId++;
}
......
......@@ -550,7 +550,14 @@ private BoundExpression HoistRefInitialization(SynthesizedLocal local, BoundAssi
// Editing await expression is not allowed. Thus all spilled fields will be present in the previous state machine.
// However, it may happen that the type changes, in which case we need to allocate a new slot.
int slotIndex;
if (slotAllocatorOpt == null || !slotAllocatorOpt.TryGetPreviousHoistedLocalSlotIndex(awaitSyntaxOpt, F.ModuleBuilderOpt.Translate(fieldType, awaitSyntaxOpt, Diagnostics), kind, id, out slotIndex))
if (slotAllocatorOpt == null ||
!slotAllocatorOpt.TryGetPreviousHoistedLocalSlotIndex(
awaitSyntaxOpt,
F.ModuleBuilderOpt.Translate(fieldType, awaitSyntaxOpt, Diagnostics),
kind,
id,
Diagnostics,
out slotIndex))
{
slotIndex = _nextFreeHoistedLocalSlot++;
}
......
......@@ -172,7 +172,13 @@ protected BoundStatement Rewrite()
// map local id to the previous id, if available:
int previousSlotIndex;
if (mapToPreviousFields && slotAllocatorOpt.TryGetPreviousHoistedLocalSlotIndex(declaratorSyntax, F.ModuleBuilderOpt.Translate(fieldType, declaratorSyntax, diagnostics), synthesizedKind, id, out previousSlotIndex))
if (mapToPreviousFields && slotAllocatorOpt.TryGetPreviousHoistedLocalSlotIndex(
declaratorSyntax,
F.ModuleBuilderOpt.Translate(fieldType, declaratorSyntax, diagnostics),
synthesizedKind,
id,
diagnostics,
out previousSlotIndex))
{
slotIndex = previousSlotIndex;
}
......
......@@ -15,7 +15,7 @@ namespace Microsoft.CodeAnalysis.CSharp.Symbols
/// <summary>
/// Represents a .NET assembly, consisting of one or more modules.
/// </summary>
internal abstract class AssemblySymbol : Symbol, IAssemblySymbolInternal
internal abstract class AssemblySymbol : Symbol, IAssemblySymbol
{
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Changes to the public interface of this class should remain synchronized with the VB version.
......@@ -78,16 +78,6 @@ public override string Name
/// </summary>
public abstract AssemblyIdentity Identity { get; }
/// <summary>
/// Assembly version pattern with wildcards represented by <see cref="ushort.MaxValue"/>,
/// or null if the version string specified in the <see cref="AssemblyVersionAttribute"/> doesn't contain a wildcard.
///
/// For example,
/// AssemblyVersion("1.2.*") is represented as 1.2.65535.65535,
/// AssemblyVersion("1.2.3.*") is represented as 1.2.3.65535.
/// </summary>
public abstract Version AssemblyVersionPattern { get; }
/// <summary>
/// Target architecture of the machine.
/// </summary>
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using Roslyn.Utilities;
using System.Diagnostics;
using System.Linq;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE
{
......@@ -92,9 +90,6 @@ public override AssemblyIdentity Identity
}
}
// TODO: https://github.com/dotnet/roslyn/issues/9000
public override Version AssemblyVersionPattern => null;
public override ImmutableArray<ModuleSymbol> Modules
{
get
......
......@@ -60,8 +60,6 @@ public override AssemblyIdentity Identity
}
}
public override Version AssemblyVersionPattern => null;
internal override ImmutableArray<byte> PublicKey
{
get { return Identity.PublicKey; }
......
......@@ -219,52 +219,27 @@ public void CreateSourceAssemblyForCompilation(CSharpCompilation compilation)
/// Used by EnC to create symbols for emit baseline. The PE symbols are used by <see cref="CSharpSymbolMatcher"/>.
///
/// The assembly references listed in the metadata AssemblyRef table are matched to the resolved references
/// stored on this <see cref="ReferenceManager"/>. We assume that the dependencies of the baseline metadata are
/// the same as the dependencies of the current compilation. This is not exactly true when the dependencies use
/// time-based versioning pattern, e.g. AssemblyVersion("1.0.*"). In that case we assume only the version
/// changed and nothing else.
///
/// Each AssemblyRef is matched against the assembly identities using an exact equality comparison modulo version.
/// AssemblyRef with lower version in metadata is matched to a PE assembly symbol with the higher version
/// (provided that the assembly name, culture, PKT and flags are the same) if there is no symbol with the exactly matching version.
/// If there are multiple symbols with higher versions selects the one with the minimal version among them.
///
/// Matching to a higher version is necessary to support EnC for projects whose P2P dependencies use time-based versioning pattern.
/// The versions of the dependent projects seen from the IDE will be higher than
/// the one written in the metadata at the time their respective baselines are built.
///
/// No other unification or further resolution is performed.
/// stored on this <see cref="ReferenceManager"/>. Each AssemblyRef is matched against the assembly identities
/// using an exact equality comparison. No unification or further resolution is performed.
/// </remarks>
/// <param name="metadata"></param>
/// <param name="importOptions"></param>
/// <param name="assemblyReferenceIdentityMap">
/// A map of the PE assembly symbol identities to the identities of the original metadata AssemblyRefs.
/// This map will be used in emit when serializing AssemblyRef table of the delta. For the delta to be compatible with
/// the original metadata we need to map the identities of the PE assembly symbols back to the original AssemblyRefs (if different).
/// In other words, we pretend that the versions of the dependencies haven't changed.
/// </param>
public PEAssemblySymbol CreatePEAssemblyForAssemblyMetadata(AssemblyMetadata metadata, MetadataImportOptions importOptions, out ImmutableDictionary<AssemblyIdentity, AssemblyIdentity> assemblyReferenceIdentityMap)
public PEAssemblySymbol CreatePEAssemblyForAssemblyMetadata(AssemblyMetadata metadata, MetadataImportOptions importOptions)
{
AssertBound();
// If the compilation has a reference from metadata to source assembly we can't share the referenced PE symbols.
Debug.Assert(!HasCircularReference);
var referencedAssembliesByIdentity = new AssemblyIdentityMap<AssemblySymbol>();
var referencedAssembliesByIdentity = new Dictionary<AssemblyIdentity, AssemblySymbol>();
foreach (var symbol in this.ReferencedAssemblies)
{
referencedAssembliesByIdentity.Add(symbol.Identity, symbol);
}
var assembly = metadata.GetAssembly();
var peReferences = assembly.AssemblyReferences.SelectAsArray(MapAssemblyIdentityToResolvedSymbol, referencedAssembliesByIdentity);
assemblyReferenceIdentityMap = GetAssemblyReferenceIdentityBaselineMap(peReferences, assembly.AssemblyReferences);
var assemblySymbol = new PEAssemblySymbol(assembly, DocumentationProvider.Default, isLinked: false, importOptions: importOptions);
var unifiedAssemblies = this.UnifiedAssemblies.WhereAsArray(unified => referencedAssembliesByIdentity.Contains(unified.OriginalReference, allowHigherVersion: false));
var unifiedAssemblies = this.UnifiedAssemblies.WhereAsArray(unified => referencedAssembliesByIdentity.ContainsKey(unified.OriginalReference));
InitializeAssemblyReuseData(assemblySymbol, peReferences, unifiedAssemblies);
if (assembly.ContainsNoPiaLocalTypes())
......@@ -275,20 +250,13 @@ public PEAssemblySymbol CreatePEAssemblyForAssemblyMetadata(AssemblyMetadata met
return assemblySymbol;
}
private static AssemblySymbol MapAssemblyIdentityToResolvedSymbol(AssemblyIdentity identity, AssemblyIdentityMap<AssemblySymbol> map)
private static AssemblySymbol MapAssemblyIdentityToResolvedSymbol(AssemblyIdentity identity, Dictionary<AssemblyIdentity, AssemblySymbol> map)
{
AssemblySymbol symbol;
if (map.TryGetValue(identity, out symbol, CompareVersionPartsSpecifiedInSource))
if (map.TryGetValue(identity, out symbol))
{
return symbol;
}
if (map.TryGetValue(identity, out symbol, (v1, v2, s) => true))
{
// TODO: https://github.com/dotnet/roslyn/issues/9004
throw new NotSupportedException($"Changing the version of an assembly reference is not allowed during debugging: '{identity}' changed version to {symbol.Identity.Version}");
}
return new MissingAssemblySymbol(identity);
}
......
......@@ -148,8 +148,6 @@ public override AssemblyIdentity Identity
}
}
public override Version AssemblyVersionPattern => _underlyingAssembly.AssemblyVersionPattern;
internal override ImmutableArray<byte> PublicKey
{
get { return _underlyingAssembly.PublicKey; }
......
......@@ -352,10 +352,6 @@ internal string SignatureKey
}
}
/// <summary>
/// Raw assembly version as specified in the AssemblyVersionAttribute, or null if none specified.
/// If the string passed to AssemblyVersionAttribute contains * the version build and/or revision numbers are set to <see cref="ushort.MaxValue"/>.
/// </summary>
private Version AssemblyVersionAttributeSetting
{
get
......@@ -382,15 +378,6 @@ private Version AssemblyVersionAttributeSetting
}
}
public override Version AssemblyVersionPattern
{
get
{
var attributeValue = AssemblyVersionAttributeSetting;
return (object)attributeValue == null || (attributeValue.Build != ushort.MaxValue && attributeValue.Revision != ushort.MaxValue) ? null : attributeValue;
}
}
internal AssemblyHashAlgorithm AssemblyHashAlgorithm
{
get
......@@ -462,6 +449,26 @@ private StrongNameKeys ComputeStrongNameKeys()
// when both attributes and command-line options specified, cmd line wins.
string keyFile = _compilation.Options.CryptoKeyFile;
// Public sign requires a keyfile
if (DeclaringCompilation.Options.PublicSign)
{
// TODO(https://github.com/dotnet/roslyn/issues/9150):
// Provide better error message if keys are provided by
// the attributes. Right now we'll just fall through to the
// "no key available" error.
if (!string.IsNullOrEmpty(keyFile) && !PathUtilities.IsAbsolute(keyFile))
{
// If keyFile has a relative path then there should be a diagnostic
// about it
Debug.Assert(!DeclaringCompilation.Options.Errors.IsEmpty);
return StrongNameKeys.None;
}
// If we're public signing, we don't need a strong name provider
return StrongNameKeys.Create(keyFile, MessageProvider.Instance);
}
if (string.IsNullOrEmpty(keyFile))
{
keyFile = this.AssemblyKeyFileAttributeSetting;
......@@ -484,16 +491,7 @@ private StrongNameKeys ComputeStrongNameKeys()
}
}
// If we're public signing, we don't need a strong name provider, just
// the file containing the public key
if (DeclaringCompilation.Options.PublicSign && keyFile != null)
{
return StrongNameKeys.Create(keyFile, MessageProvider.Instance);
}
else
{
return StrongNameKeys.Create(DeclaringCompilation.Options.StrongNameProvider, keyFile, keyContainer, MessageProvider.Instance);
}
return StrongNameKeys.Create(DeclaringCompilation.Options.StrongNameProvider, keyFile, keyContainer, MessageProvider.Instance);
}
// A collection of assemblies to which we were granted internals access by only checking matches for assembly name
......@@ -1898,7 +1896,7 @@ private AssemblyIdentity ComputeIdentity()
{
return new AssemblyIdentity(
_assemblySimpleName,
VersionHelper.GenerateVersionFromPatternAndCurrentTime(this.AssemblyVersionAttributeSetting),
this.AssemblyVersionAttributeSetting,
this.AssemblyCultureAttributeSetting,
StrongNameKeys.PublicKey,
hasPublicKey: !StrongNameKeys.PublicKey.IsDefault);
......@@ -2126,7 +2124,7 @@ private void DecodeWellKnownAttribute(ref DecodeWellKnownAttributeArguments<Attr
{
Version dummy;
string verString = (string)attribute.CommonConstructorArguments[0].Value;
if (!VersionHelper.TryParse(verString, version: out dummy))
if (!VersionHelper.TryParseAssemblyVersion(verString, allowWildcard: false, version: out dummy))
{
Location attributeArgumentSyntaxLocation = attribute.GetAttributeArgumentSyntaxLocation(0, arguments.AttributeSyntaxOpt);
arguments.Diagnostics.Add(ErrorCode.WRN_InvalidVersionFormat, attributeArgumentSyntaxLocation);
......
......@@ -11,7 +11,7 @@
"lib/portable-net45+win8+wp8+wpa81/System.Collections.Immutable.dll": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections.Immutable": "[1.1.37, )"
},
......@@ -39,8 +39,8 @@
"System.Collections.Immutable.nuspec"
]
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"sha512": "gAOQV1dsGyQfQUuzsCYFLMlI6BhfK1/2aA7JGf6gJphaLgjU4dV4hzjbE0iZXgo61VUuda2LtCBrWWZBw5897Q==",
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"sha512": "iaq5zpluF7mUMd5hFyhmZGyCSzF6glZjvNI2VAhLFQEp8sGA/tROj6NoZL42q6HhoHxi1XyGeoIXPi5hyw0+5w==",
"type": "Package",
"files": [
"[Content_Types].xml",
......@@ -50,7 +50,7 @@
"lib/dotnet5.2/System.Reflection.Metadata.xml",
"lib/portable-net45+win8/System.Reflection.Metadata.dll",
"lib/portable-net45+win8/System.Reflection.Metadata.xml",
"package/services/metadata/core-properties/9aa921f066b94690988804574c5d2231.psmdcp",
"package/services/metadata/core-properties/26ea3eeed81e48b5a161d7b4bfaa534d.psmdcp",
"System.Reflection.Metadata.nuspec",
"ThirdPartyNotices.txt"
]
......
......@@ -3730,6 +3730,15 @@ public void PublicSign()
Assert.False(parsedArgs.CompilationOptions.PublicSign);
}
[WorkItem(8360, "https://github.com/dotnet/roslyn/issues/8360")]
[Fact]
public void PublicSign_KeyFileRelativePath()
{
var parsedArgs = DefaultParse(new[] { "/publicsign", "/keyfile:test.snk", "a.cs" }, _baseDirectory);
parsedArgs.Errors.Verify();
Assert.Equal(Path.Combine(_baseDirectory, "test.snk"), parsedArgs.CompilationOptions.CryptoKeyFile);
}
[WorkItem(546301, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/546301")]
[Fact]
public void SubsystemVersionTests()
......
......@@ -70,7 +70,7 @@
"lib/net45/_._": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections.Immutable": "[1.1.37, )"
},
......@@ -233,7 +233,7 @@
"lib/net45/_._": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections.Immutable": "[1.1.37, )"
},
......@@ -566,8 +566,8 @@
"System.Linq.nuspec"
]
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"sha512": "gAOQV1dsGyQfQUuzsCYFLMlI6BhfK1/2aA7JGf6gJphaLgjU4dV4hzjbE0iZXgo61VUuda2LtCBrWWZBw5897Q==",
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"sha512": "iaq5zpluF7mUMd5hFyhmZGyCSzF6glZjvNI2VAhLFQEp8sGA/tROj6NoZL42q6HhoHxi1XyGeoIXPi5hyw0+5w==",
"type": "Package",
"files": [
"[Content_Types].xml",
......@@ -577,7 +577,7 @@
"lib/dotnet5.2/System.Reflection.Metadata.xml",
"lib/portable-net45+win8/System.Reflection.Metadata.dll",
"lib/portable-net45+win8/System.Reflection.Metadata.xml",
"package/services/metadata/core-properties/9aa921f066b94690988804574c5d2231.psmdcp",
"package/services/metadata/core-properties/26ea3eeed81e48b5a161d7b4bfaa534d.psmdcp",
"System.Reflection.Metadata.nuspec",
"ThirdPartyNotices.txt"
]
......
......@@ -54,8 +54,8 @@ class C
options: options);
comp.VerifyEmitDiagnostics(
// error CS7028: Error signing output with public key from container 'RoslynTestContainer' -- This is a test IOException
Diagnostic(ErrorCode.ERR_PublicKeyContainerFailure).WithArguments("RoslynTestContainer", "This is a test IOException").WithLocation(1, 1));
// error CS8104: An error occurred while writing the Portable Executable file.
Diagnostic(ErrorCode.ERR_PeWritingFailure).WithArguments("This is a test IOException").WithLocation(1, 1));
}
}
}
......@@ -420,6 +420,36 @@ public class C {}
Assert.Equal(CorFlags.ILOnly | CorFlags.StrongNameSigned, metadata.Module.PEReaderOpt.PEHeaders.CorHeader.Flags);
}
[Fact]
public void KeyFileFromAttributes_PublicSign()
{
string source = @"
[assembly: System.Reflection.AssemblyKeyFile(""test.snk"")]
public class C {}
";
var c = CreateCompilationWithMscorlib(source, options: TestOptions.ReleaseDll.WithPublicSign(true));
c.VerifyDiagnostics(
// error CS8102: Public signing was specified and requires a public key, but no public key was specified.
Diagnostic(ErrorCode.ERR_PublicSignButNoKey).WithLocation(1, 1));
Assert.True(c.Options.PublicSign);
}
[Fact]
public void KeyContainerFromAttributes_PublicSign()
{
string source = @"
[assembly: System.Reflection.AssemblyKeyName(""roslynTestContainer"")]
public class C {}
";
var c = CreateCompilationWithMscorlib(source, options: TestOptions.ReleaseDll.WithPublicSign(true));
c.VerifyDiagnostics(
// error CS8102: Public signing was specified and requires a public key, but no public key was specified.
Diagnostic(ErrorCode.ERR_PublicSignButNoKey).WithLocation(1, 1));
Assert.True(c.Options.PublicSign);
}
private void VerifySignedBitSetAfterEmit(Compilation comp)
{
var outStrm = new MemoryStream();
......@@ -511,8 +541,8 @@ public void KeyContainerNoSNProvider_PublicSign()
.WithPublicSign(true));
comp.VerifyDiagnostics(
// error CS7028: Error signing output with public key from container 'roslynTestContainer' -- Assembly signing not supported.
Diagnostic(ErrorCode.ERR_PublicKeyContainerFailure).WithArguments("roslynTestContainer", "Assembly signing not supported.").WithLocation(1, 1),
// error CS7102: Compilation options 'PublicSign' and 'CryptoKeyContainer' can't both be specified at the same time.
Diagnostic(ErrorCode.ERR_MutuallyExclusiveOptions).WithArguments("PublicSign", "CryptoKeyContainer").WithLocation(1, 1),
// error CS8102: Public signing was specified and requires a public key, but no public key was specified.
Diagnostic(ErrorCode.ERR_PublicSignButNoKey).WithLocation(1, 1));
}
......@@ -526,14 +556,16 @@ public void KeyContainerDesktopProvider_PublicSign()
.WithStrongNameProvider(s_defaultProvider)
.WithPublicSign(true));
comp.VerifyDiagnostics();
comp.VerifyDiagnostics(
// error CS7102: Compilation options 'PublicSign' and 'CryptoKeyContainer' can't both be specified at the same time.
Diagnostic(ErrorCode.ERR_MutuallyExclusiveOptions).WithArguments("PublicSign", "CryptoKeyContainer").WithLocation(1, 1),
// error CS8102: Public signing was specified and requires a public key, but no public key was specified.
Diagnostic(ErrorCode.ERR_PublicSignButNoKey).WithLocation(1, 1));
Assert.True(comp.Options.PublicSign);
Assert.Null(comp.Options.DelaySign);
Assert.False(comp.IsRealSigned);
Assert.NotNull(comp.Options.CryptoKeyContainer);
VerifySignedBitSetAfterEmit(comp);
}
[Fact]
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Immutable;
using System.IO;
using System.Linq;
using System.Reflection;
......@@ -2699,10 +2698,16 @@ public void BrokenOutStream()
var compilation = CreateCompilationWithMscorlib(source);
var output = new BrokenStream();
Assert.Throws<IOException>(() => compilation.Emit(output));
var result = compilation.Emit(output);
result.Diagnostics.Verify(
// error CS8104: An error occurred while writing the Portable Executable file.
Diagnostic(ErrorCode.ERR_PeWritingFailure).WithArguments("I/O error occurred.").WithLocation(1, 1));
output.BreakHow = 1;
Assert.Throws<NotSupportedException>(() => compilation.Emit(output));
result = compilation.Emit(output);
result.Diagnostics.Verify(
// error CS8104: An error occurred while writing the Portable Executable file.
Diagnostic(ErrorCode.ERR_PeWritingFailure).WithArguments("Specified method is not supported.").WithLocation(1, 1));
// disposed stream is not writable
var outReal = new MemoryStream();
......@@ -2949,5 +2954,27 @@ static int M(dynamic d, object o)
AssertEx.Equal(expectedNames, actualNames);
}
}
[Fact]
[WorkItem(3240, "https://github.com/dotnet/roslyn/pull/8227")]
public void FailingEmitter()
{
string source = @"
public class X
{
public static void Main()
{
}
}";
var compilation = CreateCompilationWithMscorlib(source);
var broken = new BrokenStream();
broken.BreakHow = 0;
var result = compilation.Emit(broken);
Assert.False(result.Success);
result.Diagnostics.Verify(
// error CS8104: An error occurred while writing the Portable Executable file.
Diagnostic(ErrorCode.ERR_PeWritingFailure).WithArguments("I/O error occurred.").WithLocation(1, 1));
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
using System.Threading;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Test.Utilities;
using Microsoft.CodeAnalysis.CSharp.UnitTests;
......@@ -22,9 +18,6 @@ namespace Microsoft.CodeAnalysis.CSharp.EditAndContinue.UnitTests
{
public class AssemblyReferencesTests : EditAndContinueTestBase
{
private static readonly CSharpCompilationOptions s_signedDll =
TestOptions.ReleaseDll.WithCryptoPublicKey(TestResources.TestKeys.PublicKey_ce65828c82a341f2);
/// <summary>
/// The baseline metadata might have less (or even different) references than
/// the current compilation. We shouldn't assume that the reference sets are the same.
......@@ -231,269 +224,5 @@ class C
diff2.EmitResult.Diagnostics.Verify();
}
[Fact]
public void DependencyVersionWildcards_Compilation()
{
TestDependencyVersionWildcards(
"1.0.0.*",
new Version(1, 0, 2000, 1001),
new Version(1, 0, 2000, 1001),
new Version(1, 0, 2000, 1002));
TestDependencyVersionWildcards(
"1.0.0.*",
new Version(1, 0, 2000, 1001),
new Version(1, 0, 2000, 1002),
new Version(1, 0, 2000, 1002));
TestDependencyVersionWildcards(
"1.0.0.*",
new Version(1, 0, 2000, 1003),
new Version(1, 0, 2000, 1002),
new Version(1, 0, 2000, 1001));
TestDependencyVersionWildcards(
"1.0.*",
new Version(1, 0, 2000, 1001),
new Version(1, 0, 2000, 1002),
new Version(1, 0, 2000, 1003));
TestDependencyVersionWildcards(
"1.0.*",
new Version(1, 0, 2000, 1001),
new Version(1, 0, 2000, 1005),
new Version(1, 0, 2000, 1002));
}
private void TestDependencyVersionWildcards(string sourceVersion, Version version0, Version version1, Version version2)
{
string srcLib = $@"
[assembly: System.Reflection.AssemblyVersion(""{sourceVersion}"")]
public class D {{ }}
";
string src0 = @"
class C
{
public static int F(D a) { return 1; }
}
";
string src1 = @"
class C
{
public static int F(D a) { return 2; }
}
";
string src2 = @"
class C
{
public static int F(D a) { return 3; }
public static int G(D a) { return 4; }
}
";
var lib0 = CreateCompilationWithMscorlib(srcLib, assemblyName: "Lib", options: TestOptions.DebugDll);
((SourceAssemblySymbol)lib0.Assembly).lazyAssemblyIdentity = new AssemblyIdentity("Lib", version0);
lib0.VerifyDiagnostics();
var lib1 = CreateCompilationWithMscorlib(srcLib, assemblyName: "Lib", options: TestOptions.DebugDll);
((SourceAssemblySymbol)lib1.Assembly).lazyAssemblyIdentity = new AssemblyIdentity("Lib", version1);
lib1.VerifyDiagnostics();
var lib2 = CreateCompilationWithMscorlib(srcLib, assemblyName: "Lib", options: TestOptions.DebugDll);
((SourceAssemblySymbol)lib2.Assembly).lazyAssemblyIdentity = new AssemblyIdentity("Lib", version2);
lib2.VerifyDiagnostics();
var compilation0 = CreateCompilation(src0, new[] { MscorlibRef, lib0.ToMetadataReference() }, assemblyName: "C", options: TestOptions.DebugDll);
var compilation1 = compilation0.WithSource(src1).WithReferences(new[] { MscorlibRef, lib1.ToMetadataReference() });
var compilation2 = compilation1.WithSource(src2).WithReferences(new[] { MscorlibRef, lib2.ToMetadataReference() });
var v0 = CompileAndVerify(compilation0);
var v1 = CompileAndVerify(compilation1);
var v2 = CompileAndVerify(compilation2);
var f0 = compilation0.GetMember<MethodSymbol>("C.F");
var f1 = compilation1.GetMember<MethodSymbol>("C.F");
var f2 = compilation2.GetMember<MethodSymbol>("C.F");
var g2 = compilation2.GetMember<MethodSymbol>("C.G");
var md0 = ModuleMetadata.CreateFromImage(v0.EmittedAssemblyData);
var generation0 = EmitBaseline.CreateInitialBaseline(md0, EmptyLocalsProvider);
var diff1 = compilation1.EmitDifference(
generation0,
ImmutableArray.Create(new SemanticEdit(SemanticEditKind.Update, f0, f1)));
var diff2 = compilation2.EmitDifference(
diff1.NextGeneration,
ImmutableArray.Create(
new SemanticEdit(SemanticEditKind.Update, f1, f2),
new SemanticEdit(SemanticEditKind.Insert, null, g2)));
var md1 = diff1.GetMetadata();
var md2 = diff2.GetMetadata();
var aggReader = new AggregatedMetadataReader(md0.MetadataReader, md1.Reader, md2.Reader);
// all references to Lib should be to the baseline version:
VerifyAssemblyReferences(aggReader, new[]
{
"mscorlib, 4.0.0.0",
"Lib, " + lib0.Assembly.Identity.Version,
"mscorlib, 4.0.0.0",
"Lib, " + lib0.Assembly.Identity.Version,
"mscorlib, 4.0.0.0",
"Lib, " + lib0.Assembly.Identity.Version,
});
}
[Fact]
public void DependencyVersionWildcards_Metadata()
{
string srcLib = @"
[assembly: System.Reflection.AssemblyVersion(""1.0.*"")]
public class D { }
";
string src0 = @"
class C
{
public static int F(D a) { return 1; }
}
";
string src1 = @"
class C
{
public static int F(D a) { return 2; }
}
";
string src2 = @"
class C
{
public static int F(D a) { return 3; }
public static int G(D a) { return 4; }
}
";
var lib0 = CreateCompilationWithMscorlib(srcLib, assemblyName: "Lib", options: TestOptions.DebugDll);
((SourceAssemblySymbol)lib0.Assembly).lazyAssemblyIdentity = new AssemblyIdentity("Lib", new Version(1, 0, 2000, 1001));
lib0.VerifyDiagnostics();
var lib1 = CreateCompilationWithMscorlib(srcLib, assemblyName: "Lib", options: TestOptions.DebugDll);
((SourceAssemblySymbol)lib1.Assembly).lazyAssemblyIdentity = new AssemblyIdentity("Lib", new Version(1, 0, 2000, 1002));
lib1.VerifyDiagnostics();
var lib2 = CreateCompilationWithMscorlib(srcLib, assemblyName: "Lib", options: TestOptions.DebugDll);
((SourceAssemblySymbol)lib2.Assembly).lazyAssemblyIdentity = new AssemblyIdentity("Lib", new Version(1, 0, 2000, 1003));
lib2.VerifyDiagnostics();
var compilation0 = CreateCompilation(src0, new[] { MscorlibRef, lib0.EmitToImageReference() }, assemblyName: "C", options: TestOptions.DebugDll);
var compilation1 = compilation0.WithSource(src1).WithReferences(new[] { MscorlibRef, lib1.EmitToImageReference() });
var compilation2 = compilation1.WithSource(src2).WithReferences(new[] { MscorlibRef, lib2.EmitToImageReference() });
var v0 = CompileAndVerify(compilation0);
var v1 = CompileAndVerify(compilation1);
var v2 = CompileAndVerify(compilation2);
var f0 = compilation0.GetMember<MethodSymbol>("C.F");
var f1 = compilation1.GetMember<MethodSymbol>("C.F");
var f2 = compilation2.GetMember<MethodSymbol>("C.F");
var g2 = compilation2.GetMember<MethodSymbol>("C.G");
var md0 = ModuleMetadata.CreateFromImage(v0.EmittedAssemblyData);
var generation0 = EmitBaseline.CreateInitialBaseline(md0, EmptyLocalsProvider);
var diff1 = compilation1.EmitDifference(
generation0,
ImmutableArray.Create(new SemanticEdit(SemanticEditKind.Update, f0, f1)));
diff1.EmitResult.Diagnostics.Verify(
// error CS7038: Failed to emit module 'C'.
Diagnostic(ErrorCode.ERR_ModuleEmitFailure).WithArguments("C"));
}
[Fact, WorkItem(9004, "https://github.com/dotnet/roslyn/issues/9004")]
public void DependencyVersionWildcardsCollisions()
{
string srcLib01 = @"
[assembly: System.Reflection.AssemblyVersion(""1.0.0.1"")]
public class D { }
";
string srcLib02 = @"
[assembly: System.Reflection.AssemblyVersion(""1.0.0.2"")]
public class D { }
";
string srcLib11 = @"
[assembly: System.Reflection.AssemblyVersion(""1.0.1.1"")]
public class D { }
";
string srcLib12 = @"
[assembly: System.Reflection.AssemblyVersion(""1.0.1.2"")]
public class D { }
";
string src0 = @"
extern alias L0;
extern alias L1;
class C
{
public static int F(L0::D a, L1::D b) => 1;
}
";
string src1 = @"
extern alias L0;
extern alias L1;
class C
{
public static int F(L0::D a, L1::D b) => 2;
}
";
var lib01 = CreateCompilationWithMscorlib(srcLib01, assemblyName: "Lib", options: s_signedDll).VerifyDiagnostics();
var ref01 = lib01.ToMetadataReference(ImmutableArray.Create("L0"));
var lib02 = CreateCompilationWithMscorlib(srcLib02, assemblyName: "Lib", options: s_signedDll).VerifyDiagnostics();
var ref02 = lib02.ToMetadataReference(ImmutableArray.Create("L0"));
var lib11 = CreateCompilationWithMscorlib(srcLib11, assemblyName: "Lib", options: s_signedDll).VerifyDiagnostics();
var ref11 = lib11.ToMetadataReference(ImmutableArray.Create("L1"));
var lib12 = CreateCompilationWithMscorlib(srcLib12, assemblyName: "Lib", options: s_signedDll).VerifyDiagnostics();
var ref12 = lib12.ToMetadataReference(ImmutableArray.Create("L1"));
var compilation0 = CreateCompilation(src0, new[] { MscorlibRef, ref01, ref11 }, assemblyName: "C", options: TestOptions.DebugDll);
var compilation1 = compilation0.WithSource(src1).WithReferences(new[] { MscorlibRef, ref02, ref12 });
var v0 = CompileAndVerify(compilation0);
var f0 = compilation0.GetMember<MethodSymbol>("C.F");
var f1 = compilation1.GetMember<MethodSymbol>("C.F");
var md0 = ModuleMetadata.CreateFromImage(v0.EmittedAssemblyData);
var generation0 = EmitBaseline.CreateInitialBaseline(md0, EmptyLocalsProvider);
var diff1 = compilation1.EmitDifference(
generation0,
ImmutableArray.Create(new SemanticEdit(SemanticEditKind.Update, f0, f1)));
// TODO: message should be: Changing the version of an assembly reference is not allowed during debugging
diff1.EmitResult.Diagnostics.Verify(
// error CS7038: Failed to emit module 'C'.
Diagnostic(ErrorCode.ERR_ModuleEmitFailure).WithArguments("C"));
}
public void VerifyAssemblyReferences(AggregatedMetadataReader reader, string[] expected)
{
AssertEx.Equal(expected, reader.GetAssemblyReferences().Select(aref => $"{reader.GetString(aref.Name)}, {aref.Version}"));
}
}
}
......@@ -4702,5 +4702,119 @@ .maxstack 5
"<>f__AnonymousType5<<<>h__TransparentIdentifier0>j__TPar, <length>j__TPar>: {Equals, GetHashCode, ToString}",
"<>f__AnonymousType2<<<>h__TransparentIdentifier0>j__TPar, <y>j__TPar>: {Equals, GetHashCode, ToString}");
}
[Fact, WorkItem(9119, "https://github.com/dotnet/roslyn/issues/9119")]
public void MissingIteratorStateMachineAttribute()
{
var source0 = MarkedSource(@"
using System;
using System.Collections.Generic;
class C
{
public IEnumerable<int> F()
{
int <N:0>a = 0</N:0>;
<N:1>yield return 0;</N:1>
Console.WriteLine(a);
}
}
");
var source1 = MarkedSource(@"
using System;
using System.Collections.Generic;
class C
{
public IEnumerable<int> F()
{
int <N:0>a = 1</N:0>;
<N:1>yield return 1;</N:1>
Console.WriteLine(a);
}
}
");
var compilation0 = CreateCompilationWithMscorlib(new[] { source0.Tree }, options: ComSafeDebugDll);
var compilation1 = compilation0.WithSource(source1.Tree);
// older versions of mscorlib don't contain IteratorStateMachineAttribute
Assert.Null(compilation0.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_IteratorStateMachineAttribute__ctor));
var v0 = CompileAndVerify(compilation0);
v0.VerifyDiagnostics();
var md0 = ModuleMetadata.CreateFromImage(v0.EmittedAssemblyData);
var f0 = compilation0.GetMember<MethodSymbol>("C.F");
var f1 = compilation1.GetMember<MethodSymbol>("C.F");
var generation0 = EmitBaseline.CreateInitialBaseline(md0, v0.CreateSymReader().GetEncMethodDebugInfo);
var diff1 = compilation1.EmitDifference(
generation0,
ImmutableArray.Create(
new SemanticEdit(SemanticEditKind.Update, f0, f1, GetSyntaxMapFromMarkers(source0, source1), preserveLocalVariables: true)));
diff1.EmitResult.Diagnostics.Verify(
// error CS7038: Failed to emit module '{0}'.
Diagnostic(ErrorCode.ERR_ModuleEmitFailure).WithArguments(compilation0.SourceModule.Name));
}
[Fact, WorkItem(9119, "https://github.com/dotnet/roslyn/issues/9119")]
public void MissingAsyncStateMachineAttribute()
{
var source0 = MarkedSource(@"
using System.Threading.Tasks;
class C
{
public async Task<int> F()
{
int <N:0>a = 0</N:0>;
<N:1>await new Task();</N:1>
return a;
}
}
");
var source1 = MarkedSource(@"
using System.Threading.Tasks;
class C
{
public async Task<int> F()
{
int <N:0>a = 1</N:0>;
<N:1>await new Task();</N:1>
return a;
}
}
");
var compilation0 = CreateCompilation(new[] { source0.Tree }, new[] { TestReferences.NetFx.Minimal.mincorlib, TestReferences.NetFx.Minimal.minasync }, options: ComSafeDebugDll);
var compilation1 = compilation0.WithSource(source1.Tree);
// older versions of mscorlib don't contain AsyncStateMachineAttribute, IteratorStateMachineAttribute
Assert.Null(compilation0.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_AsyncStateMachineAttribute__ctor));
Assert.Null(compilation0.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_IteratorStateMachineAttribute__ctor));
var v0 = CompileAndVerify(compilation0, verify: false);
var md0 = ModuleMetadata.CreateFromImage(v0.EmittedAssemblyData);
var f0 = compilation0.GetMember<MethodSymbol>("C.F");
var f1 = compilation1.GetMember<MethodSymbol>("C.F");
var generation0 = EmitBaseline.CreateInitialBaseline(md0, v0.CreateSymReader().GetEncMethodDebugInfo);
var diff1 = compilation1.EmitDifference(
generation0,
ImmutableArray.Create(
new SemanticEdit(SemanticEditKind.Update, f0, f1, GetSyntaxMapFromMarkers(source0, source1), preserveLocalVariables: true)));
diff1.EmitResult.Diagnostics.Verify(
// error CS7038: Failed to emit module '{0}'.
Diagnostic(ErrorCode.ERR_ModuleEmitFailure).WithArguments(compilation0.SourceModule.Name),
// error CS7038: Failed to emit module '{0}'.
Diagnostic(ErrorCode.ERR_ModuleEmitFailure).WithArguments(compilation0.SourceModule.Name));
}
}
}
......@@ -20,71 +20,4 @@ public Stream GetXmlInclude(SyntaxTree syntaxTree, string xmlIncludeFile)
throw new NotImplementedException();
}
}
internal class BrokenStream : Stream
{
public int BreakHow;
public override bool CanRead
{
get { return true; }
}
public override bool CanSeek
{
get { return true; }
}
public override bool CanWrite
{
get { return true; }
}
public override void Flush()
{
}
public override long Length
{
get
{
return 0;
}
}
public override long Position
{
get
{
return 0;
}
set
{
if (BreakHow == 1)
throw new NotSupportedException();
}
}
public override int Read(byte[] buffer, int offset, int count)
{
return 0;
}
public override long Seek(long offset, SeekOrigin origin)
{
return 0;
}
public override void SetLength(long value)
{
if (BreakHow == 2)
throw new IOException();
}
public override void Write(byte[] buffer, int offset, int count)
{
if (BreakHow == 0)
throw new IOException();
}
}
}
......@@ -70,7 +70,7 @@
"lib/net45/_._": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections.Immutable": "[1.1.37, )"
},
......@@ -233,7 +233,7 @@
"lib/net45/_._": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections.Immutable": "[1.1.37, )"
},
......@@ -566,8 +566,8 @@
"System.Linq.nuspec"
]
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"sha512": "gAOQV1dsGyQfQUuzsCYFLMlI6BhfK1/2aA7JGf6gJphaLgjU4dV4hzjbE0iZXgo61VUuda2LtCBrWWZBw5897Q==",
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"sha512": "iaq5zpluF7mUMd5hFyhmZGyCSzF6glZjvNI2VAhLFQEp8sGA/tROj6NoZL42q6HhoHxi1XyGeoIXPi5hyw0+5w==",
"type": "Package",
"files": [
"[Content_Types].xml",
......@@ -577,7 +577,7 @@
"lib/dotnet5.2/System.Reflection.Metadata.xml",
"lib/portable-net45+win8/System.Reflection.Metadata.dll",
"lib/portable-net45+win8/System.Reflection.Metadata.xml",
"package/services/metadata/core-properties/9aa921f066b94690988804574c5d2231.psmdcp",
"package/services/metadata/core-properties/26ea3eeed81e48b5a161d7b4bfaa534d.psmdcp",
"System.Reflection.Metadata.nuspec",
"ThirdPartyNotices.txt"
]
......
......@@ -1529,6 +1529,41 @@ public void M1()
Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.Id, "1").WithLocation(12, 12));
}
[WorkItem(9113, "https://github.com/dotnet/roslyn/issues/9113")]
[Fact]
public void ConversionExpressionCSharp()
{
const string source = @"
class X
{
static void Main()
{
string three = 3.ToString();
int x = null.Length;
int y = string.Empty;
int i = global::MyType();
}
}";
CreateCompilationWithMscorlib45(source)
.VerifyDiagnostics(
// (8,17): error CS0023: Operator '.' cannot be applied to operand of type '<null>'
// int x = null.Length;
Diagnostic(ErrorCode.ERR_BadUnaryOp, "null.Length").WithArguments(".", "<null>").WithLocation(8, 17),
// (10,17): error CS0029: Cannot implicitly convert type 'string' to 'int'
// int y = string.Empty;
Diagnostic(ErrorCode.ERR_NoImplicitConv, "string.Empty").WithArguments("string", "int").WithLocation(10, 17),
// (12,25): error CS0400: The type or namespace name 'MyType' could not be found in the global namespace (are you missing an assembly reference?)
// int i = global::MyType();
Diagnostic(ErrorCode.ERR_GlobalSingleTypeNameNotFound, "MyType").WithArguments("MyType", "<global namespace>").WithLocation(12, 25))
.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new ConversionExpressionCSharpTestAnalyzer() }, null, null, false,
Diagnostic(ConversionExpressionCSharpTestAnalyzer.InvalidConversionExpressionDescriptor.Id, "null.Length").WithLocation(8, 17),
Diagnostic(ConversionExpressionCSharpTestAnalyzer.InvalidConversionExpressionDescriptor.Id, "string.Empty").WithLocation(10, 17),
Diagnostic(ConversionExpressionCSharpTestAnalyzer.InvalidConversionExpressionDescriptor.Id, "global::MyType()").WithLocation(12, 17));
}
[WorkItem(8114, "https://github.com/dotnet/roslyn/issues/8114")]
[Fact]
public void InvalidOperatorCSharp()
......
......@@ -78,7 +78,7 @@
"lib/net45/_._": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections.Immutable": "[1.1.37, )"
},
......@@ -249,7 +249,7 @@
"lib/net45/_._": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections.Immutable": "[1.1.37, )"
},
......@@ -598,8 +598,8 @@
"System.Linq.nuspec"
]
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"sha512": "gAOQV1dsGyQfQUuzsCYFLMlI6BhfK1/2aA7JGf6gJphaLgjU4dV4hzjbE0iZXgo61VUuda2LtCBrWWZBw5897Q==",
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"sha512": "iaq5zpluF7mUMd5hFyhmZGyCSzF6glZjvNI2VAhLFQEp8sGA/tROj6NoZL42q6HhoHxi1XyGeoIXPi5hyw0+5w==",
"type": "Package",
"files": [
"[Content_Types].xml",
......@@ -609,7 +609,7 @@
"lib/dotnet5.2/System.Reflection.Metadata.xml",
"lib/portable-net45+win8/System.Reflection.Metadata.dll",
"lib/portable-net45+win8/System.Reflection.Metadata.xml",
"package/services/metadata/core-properties/9aa921f066b94690988804574c5d2231.psmdcp",
"package/services/metadata/core-properties/26ea3eeed81e48b5a161d7b4bfaa534d.psmdcp",
"System.Reflection.Metadata.nuspec",
"ThirdPartyNotices.txt"
]
......
......@@ -26,6 +26,20 @@ namespace Microsoft.CodeAnalysis.CSharp.UnitTests
{
public class CompilationAPITests : CSharpTestBase
{
[WorkItem(8360, "https://github.com/dotnet/roslyn/issues/8360")]
[Fact]
public void PublicSignWithRelativeKeyPath()
{
var options = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)
.WithPublicSign(true).WithCryptoKeyFile("test.snk");
var comp = CSharpCompilation.Create("test", options: options);
comp.VerifyDiagnostics(
// error CS7088: Invalid 'CryptoKeyFile' value: 'test.snk'.
Diagnostic(ErrorCode.ERR_BadCompilationOptionValue).WithArguments("CryptoKeyFile", "test.snk").WithLocation(1, 1),
// error CS8102: Public signing was specified and requires a public key, but no public key was specified.
Diagnostic(ErrorCode.ERR_PublicSignButNoKey).WithLocation(1, 1));
}
[Fact]
public void CompilationName()
{
......
......@@ -24,8 +24,6 @@ public override AssemblyIdentity Identity
get { return new AssemblyIdentity(_name); }
}
public override Version AssemblyVersionPattern => null;
internal override ImmutableArray<byte> PublicKey
{
get { throw new NotImplementedException(); }
......
......@@ -70,7 +70,7 @@
"lib/net45/_._": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections.Immutable": "[1.1.37, )"
},
......@@ -233,7 +233,7 @@
"lib/net45/_._": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections.Immutable": "[1.1.37, )"
},
......@@ -566,8 +566,8 @@
"System.Linq.nuspec"
]
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"sha512": "gAOQV1dsGyQfQUuzsCYFLMlI6BhfK1/2aA7JGf6gJphaLgjU4dV4hzjbE0iZXgo61VUuda2LtCBrWWZBw5897Q==",
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"sha512": "iaq5zpluF7mUMd5hFyhmZGyCSzF6glZjvNI2VAhLFQEp8sGA/tROj6NoZL42q6HhoHxi1XyGeoIXPi5hyw0+5w==",
"type": "Package",
"files": [
"[Content_Types].xml",
......@@ -577,7 +577,7 @@
"lib/dotnet5.2/System.Reflection.Metadata.xml",
"lib/portable-net45+win8/System.Reflection.Metadata.dll",
"lib/portable-net45+win8/System.Reflection.Metadata.xml",
"package/services/metadata/core-properties/9aa921f066b94690988804574c5d2231.psmdcp",
"package/services/metadata/core-properties/26ea3eeed81e48b5a161d7b4bfaa534d.psmdcp",
"System.Reflection.Metadata.nuspec",
"ThirdPartyNotices.txt"
]
......
......@@ -245,7 +245,7 @@
"ref/dotnet/System.Reflection.Extensions.dll": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections": "4.0.0",
"System.Collections.Immutable": "1.1.37",
......@@ -583,27 +583,23 @@
},
"Microsoft.DiaSymReader/1.0.7": {
"sha512": "4tPrkKu02w87HEvoubBGm7Hqjps69DucsBWQvGezwvDV5RJt+eZqdmdC/jNH1qn6hIem9JpJnLBK0abBzhErOg==",
"type": "Package",
"type": "package",
"files": [
"Microsoft.DiaSymReader.1.0.7.nupkg.sha512",
"Microsoft.DiaSymReader.nuspec",
"[Content_Types].xml",
"_rels/.rels",
"lib/net20/Microsoft.DiaSymReader.dll",
"lib/net20/Microsoft.DiaSymReader.xml",
"lib/portable-net45+win8/Microsoft.DiaSymReader.dll",
"lib/portable-net45+win8/Microsoft.DiaSymReader.xml",
"package/services/metadata/core-properties/8754926735b64532b55b0acd21f93808.psmdcp"
"lib/portable-net45+win8/Microsoft.DiaSymReader.xml"
]
},
"Microsoft.DiaSymReader.Native/1.3.3": {
"sha512": "mjATkm+L2UlP35gO/ExNutLDfgX4iiwz1l/8sYVoeGHp5WnkEDu0NfIEsC4Oy/pCYeRw0/6SGB+kArJVNNvENQ==",
"type": "Package",
"type": "package",
"files": [
"Microsoft.DiaSymReader.Native.1.3.3.nupkg.sha512",
"Microsoft.DiaSymReader.Native.nuspec",
"[Content_Types].xml",
"_rels/.rels",
"build/Microsoft.DiaSymReader.Native.props",
"package/services/metadata/core-properties/fdc58d35421849398d4c224d791a4bc4.psmdcp",
"runtimes/win-x64/native/Microsoft.DiaSymReader.Native.amd64.dll",
"runtimes/win-x86/native/Microsoft.DiaSymReader.Native.x86.dll",
"runtimes/win/native/Microsoft.DiaSymReader.Native.amd64.dll",
......@@ -764,16 +760,14 @@
},
"System.Collections.Immutable/1.1.37": {
"sha512": "fTpqwZYBzoklTT+XjTRK8KxvmrGkYHzBiylCcKyQcxiOM8k+QvhNBxRvFHDWzy4OEP5f8/9n+xQ9mEgEXY+muA==",
"type": "Package",
"type": "package",
"files": [
"System.Collections.Immutable.1.1.37.nupkg.sha512",
"System.Collections.Immutable.nuspec",
"[Content_Types].xml",
"_rels/.rels",
"lib/dotnet/System.Collections.Immutable.dll",
"lib/dotnet/System.Collections.Immutable.xml",
"lib/portable-net45+win8+wp8+wpa81/System.Collections.Immutable.dll",
"lib/portable-net45+win8+wp8+wpa81/System.Collections.Immutable.xml",
"package/services/metadata/core-properties/a02fdeabe1114a24bba55860b8703852.psmdcp"
"lib/portable-net45+win8+wp8+wpa81/System.Collections.Immutable.xml"
]
},
"System.Console/4.0.0-beta-23504": {
......@@ -1076,18 +1070,16 @@
},
"System.Linq/4.0.0": {
"sha512": "r6Hlc+ytE6m/9UBr+nNRRdoJEWjoeQiT3L3lXYFDHoXk3VYsRBCDNXrawcexw7KPLaH0zamQLiAb6avhZ50cGg==",
"type": "Package",
"type": "package",
"files": [
"System.Linq.4.0.0.nupkg.sha512",
"System.Linq.nuspec",
"[Content_Types].xml",
"_rels/.rels",
"lib/dotnet/System.Linq.dll",
"lib/net45/_._",
"lib/netcore50/System.Linq.dll",
"lib/win8/_._",
"lib/wp80/_._",
"lib/wpa81/_._",
"package/services/metadata/core-properties/6fcde56ce4094f6a8fff4b28267da532.psmdcp",
"ref/dotnet/System.Linq.dll",
"ref/dotnet/System.Linq.xml",
"ref/dotnet/de/System.Linq.xml",
......@@ -1248,20 +1240,18 @@
"runtimes/win8-aot/lib/netcore50/System.Reflection.Extensions.dll"
]
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"sha512": "gAOQV1dsGyQfQUuzsCYFLMlI6BhfK1/2aA7JGf6gJphaLgjU4dV4hzjbE0iZXgo61VUuda2LtCBrWWZBw5897Q==",
"type": "Package",
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"sha512": "iaq5zpluF7mUMd5hFyhmZGyCSzF6glZjvNI2VAhLFQEp8sGA/tROj6NoZL42q6HhoHxi1XyGeoIXPi5hyw0+5w==",
"type": "package",
"files": [
"System.Reflection.Metadata.1.2.0-rc2-23826.nupkg.sha512",
"System.Reflection.Metadata.nuspec",
"ThirdPartyNotices.txt",
"[Content_Types].xml",
"_rels/.rels",
"dotnet_library_license.txt",
"lib/dotnet5.2/System.Reflection.Metadata.dll",
"lib/dotnet5.2/System.Reflection.Metadata.xml",
"lib/portable-net45+win8/System.Reflection.Metadata.dll",
"lib/portable-net45+win8/System.Reflection.Metadata.xml",
"package/services/metadata/core-properties/9aa921f066b94690988804574c5d2231.psmdcp"
"lib/portable-net45+win8/System.Reflection.Metadata.xml"
]
},
"System.Reflection.Primitives/4.0.0": {
......@@ -1330,18 +1320,16 @@
},
"System.Resources.ResourceManager/4.0.0": {
"sha512": "qmqeZ4BJgjfU+G2JbrZt4Dk1LsMxO4t+f/9HarNY6w8pBgweO6jT+cknUH7c3qIrGvyUqraBhU45Eo6UtA0fAw==",
"type": "Package",
"type": "package",
"files": [
"System.Resources.ResourceManager.4.0.0.nupkg.sha512",
"System.Resources.ResourceManager.nuspec",
"[Content_Types].xml",
"_rels/.rels",
"lib/DNXCore50/System.Resources.ResourceManager.dll",
"lib/net45/_._",
"lib/netcore50/System.Resources.ResourceManager.dll",
"lib/win8/_._",
"lib/wp80/_._",
"lib/wpa81/_._",
"package/services/metadata/core-properties/657a73ee3f09479c9fedb9538ade8eac.psmdcp",
"ref/dotnet/System.Resources.ResourceManager.dll",
"ref/dotnet/System.Resources.ResourceManager.xml",
"ref/dotnet/de/System.Resources.ResourceManager.xml",
......@@ -1770,50 +1758,42 @@
},
"xunit/2.1.0": {
"sha512": "u/7VQSOSXa7kSG4iK6Lcn7RqKZQ3hk7cnyMNVMpXHSP0RI5VQEtc44hvkG3LyWOVsx1dhUDD3rPAHAxyOUDQJw==",
"type": "Package",
"type": "package",
"files": [
"[Content_Types].xml",
"_rels/.rels",
"package/services/metadata/core-properties/645916a897f44189a642f33e571d5b90.psmdcp",
"xunit.2.1.0.nupkg.sha512",
"xunit.nuspec"
]
},
"xunit.abstractions/2.0.0": {
"sha512": "NAdxKQRzuLnCZ0g++x6i87/8rMBpQoRiRlRNLAqfODm2zJPbteHRoSER3DXfxnqrHXyBJT8rFaZ8uveBeQyaMA==",
"type": "Package",
"type": "package",
"files": [
"[Content_Types].xml",
"_rels/.rels",
"lib/net35/xunit.abstractions.dll",
"lib/net35/xunit.abstractions.xml",
"lib/portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS/xunit.abstractions.dll",
"lib/portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS/xunit.abstractions.xml",
"package/services/metadata/core-properties/24083640fee244bf9de77f4c35d40a72.psmdcp",
"xunit.abstractions.2.0.0.nupkg.sha512",
"xunit.abstractions.nuspec"
]
},
"xunit.assert/2.1.0": {
"sha512": "Hhhw+YaTe+BGhbr57dxVE+6VJk8BfThqFFii1XIsSZ4qx+SSCixprJC10JkiLRVSTfWyT8W/4nAf6NQgIrmBxA==",
"type": "Package",
"type": "package",
"files": [
"[Content_Types].xml",
"_rels/.rels",
"lib/dotnet/xunit.assert.dll",
"lib/dotnet/xunit.assert.pdb",
"lib/dotnet/xunit.assert.xml",
"lib/portable-net45+win8+wp8+wpa81/xunit.assert.dll",
"lib/portable-net45+win8+wp8+wpa81/xunit.assert.pdb",
"lib/portable-net45+win8+wp8+wpa81/xunit.assert.xml",
"package/services/metadata/core-properties/4f538d979dfc48ed9b4c20e5a69d87b1.psmdcp",
"xunit.assert.2.1.0.nupkg.sha512",
"xunit.assert.nuspec"
]
},
"xunit.core/2.1.0": {
"sha512": "jlbYdPbnkPIRwJllcT/tQZCNsSElVDEymdpJfH79uTUrPARkELVYw9o/zhAjKZXmeikGqGK5C2Yny4gTNoEu0Q==",
"type": "Package",
"type": "package",
"files": [
"[Content_Types].xml",
"_rels/.rels",
"build/_desktop/xunit.execution.desktop.dll",
"build/dnx451/_._",
"build/monoandroid/_._",
......@@ -1825,16 +1805,14 @@
"build/wp8/_._",
"build/wpa81/xunit.core.props",
"build/xamarinios/_._",
"package/services/metadata/core-properties/cce23a490b7f4272adfe9aa57c4e1ca3.psmdcp",
"xunit.core.2.1.0.nupkg.sha512",
"xunit.core.nuspec"
]
},
"xunit.extensibility.core/2.1.0": {
"sha512": "ANWM3WxeaeHjACLRlmrv+xOc0WAcr3cvIiJE+gqbdzTv1NCH4p1VDyT+8WmmdCc9db0WFiJLaDy4YTYsL1wWXw==",
"type": "Package",
"type": "package",
"files": [
"[Content_Types].xml",
"_rels/.rels",
"lib/dotnet/xunit.core.dll",
"lib/dotnet/xunit.core.dll.tdnet",
"lib/dotnet/xunit.core.pdb",
......@@ -1847,16 +1825,14 @@
"lib/portable-net45+win8+wp8+wpa81/xunit.core.xml",
"lib/portable-net45+win8+wp8+wpa81/xunit.runner.tdnet.dll",
"lib/portable-net45+win8+wp8+wpa81/xunit.runner.utility.desktop.dll",
"package/services/metadata/core-properties/5218831c5b01422bb82b23cafd6488b3.psmdcp",
"xunit.extensibility.core.2.1.0.nupkg.sha512",
"xunit.extensibility.core.nuspec"
]
},
"xunit.extensibility.execution/2.1.0": {
"sha512": "tAoNafoVknKa3sZJPMvtZRnhOSk3gasEGeceSm7w/gyGwsR/OXFxndWJB1xSHeoy33d3Z6jFqn4A3j+pWCF0Ew==",
"type": "Package",
"type": "package",
"files": [
"[Content_Types].xml",
"_rels/.rels",
"lib/dnx451/xunit.execution.dotnet.dll",
"lib/dnx451/xunit.execution.dotnet.pdb",
"lib/dnx451/xunit.execution.dotnet.xml",
......@@ -1887,7 +1863,7 @@
"lib/xamarinios/xunit.execution.dotnet.dll",
"lib/xamarinios/xunit.execution.dotnet.pdb",
"lib/xamarinios/xunit.execution.dotnet.xml",
"package/services/metadata/core-properties/9f5f1211ea9a4e748cecce63d1c73e30.psmdcp",
"xunit.extensibility.execution.2.1.0.nupkg.sha512",
"xunit.extensibility.execution.nuspec"
]
}
......
......@@ -70,7 +70,7 @@
"lib/net45/_._": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections.Immutable": "[1.1.37, )"
},
......@@ -233,7 +233,7 @@
"lib/net45/_._": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections.Immutable": "[1.1.37, )"
},
......@@ -566,8 +566,8 @@
"System.Linq.nuspec"
]
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"sha512": "gAOQV1dsGyQfQUuzsCYFLMlI6BhfK1/2aA7JGf6gJphaLgjU4dV4hzjbE0iZXgo61VUuda2LtCBrWWZBw5897Q==",
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"sha512": "iaq5zpluF7mUMd5hFyhmZGyCSzF6glZjvNI2VAhLFQEp8sGA/tROj6NoZL42q6HhoHxi1XyGeoIXPi5hyw0+5w==",
"type": "Package",
"files": [
"[Content_Types].xml",
......@@ -577,7 +577,7 @@
"lib/dotnet5.2/System.Reflection.Metadata.xml",
"lib/portable-net45+win8/System.Reflection.Metadata.dll",
"lib/portable-net45+win8/System.Reflection.Metadata.xml",
"package/services/metadata/core-properties/9aa921f066b94690988804574c5d2231.psmdcp",
"package/services/metadata/core-properties/26ea3eeed81e48b5a161d7b4bfaa534d.psmdcp",
"System.Reflection.Metadata.nuspec",
"ThirdPartyNotices.txt"
]
......
{
"dependencies": {
"Microsoft.DiaSymReader.Native": "1.3.3",
"Microsoft.DiaSymReader.Native": "1.3.3"
},
"frameworks": {
"net45": { }
......
......@@ -54,7 +54,7 @@
"lib/net45/_._": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections.Immutable": "1.1.37"
},
......@@ -150,7 +150,7 @@
"lib/net45/_._": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections.Immutable": "1.1.37"
},
......@@ -246,7 +246,7 @@
"lib/net45/_._": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections.Immutable": "1.1.37"
},
......@@ -342,7 +342,7 @@
"lib/net45/_._": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections.Immutable": "1.1.37"
},
......@@ -438,7 +438,7 @@
"lib/net45/_._": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections.Immutable": "1.1.37"
},
......@@ -534,7 +534,7 @@
"lib/net45/_._": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections.Immutable": "1.1.37"
},
......@@ -630,7 +630,7 @@
"lib/net45/_._": {}
}
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"dependencies": {
"System.Collections.Immutable": "1.1.37"
},
......@@ -678,13 +678,11 @@
"libraries": {
"Microsoft.DiaSymReader.Native/1.3.3": {
"sha512": "mjATkm+L2UlP35gO/ExNutLDfgX4iiwz1l/8sYVoeGHp5WnkEDu0NfIEsC4Oy/pCYeRw0/6SGB+kArJVNNvENQ==",
"type": "Package",
"type": "package",
"files": [
"Microsoft.DiaSymReader.Native.1.3.3.nupkg.sha512",
"Microsoft.DiaSymReader.Native.nuspec",
"[Content_Types].xml",
"_rels/.rels",
"build/Microsoft.DiaSymReader.Native.props",
"package/services/metadata/core-properties/fdc58d35421849398d4c224d791a4bc4.psmdcp",
"runtimes/win-x64/native/Microsoft.DiaSymReader.Native.amd64.dll",
"runtimes/win-x86/native/Microsoft.DiaSymReader.Native.x86.dll",
"runtimes/win/native/Microsoft.DiaSymReader.Native.amd64.dll",
......@@ -695,12 +693,11 @@
},
"System.Collections/4.0.0": {
"sha512": "i2vsGDIEbWdHcUSNDPKZP/ZWod6o740el7mGTCy0dqbCxQh74W4QoC+klUwPEtGEFuvzJ7bJgvwJqscosVNyZQ==",
"type": "Package",
"type": "package",
"files": [
"License.rtf",
"System.Collections.4.0.0.nupkg.sha512",
"System.Collections.nuspec",
"[Content_Types].xml",
"_rels/.rels",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net45/_._",
......@@ -709,7 +706,6 @@
"lib/wpa81/_._",
"lib/xamarinios10/_._",
"lib/xamarinmac20/_._",
"package/services/metadata/core-properties/24c5f986c3534c16ad303a35c4af021d.psmdcp",
"ref/MonoAndroid10/_._",
"ref/MonoTouch10/_._",
"ref/dotnet/System.Collections.dll",
......@@ -744,26 +740,23 @@
},
"System.Collections.Immutable/1.1.37": {
"sha512": "fTpqwZYBzoklTT+XjTRK8KxvmrGkYHzBiylCcKyQcxiOM8k+QvhNBxRvFHDWzy4OEP5f8/9n+xQ9mEgEXY+muA==",
"type": "Package",
"type": "package",
"files": [
"System.Collections.Immutable.1.1.37.nupkg.sha512",
"System.Collections.Immutable.nuspec",
"[Content_Types].xml",
"_rels/.rels",
"lib/dotnet/System.Collections.Immutable.dll",
"lib/dotnet/System.Collections.Immutable.xml",
"lib/portable-net45+win8+wp8+wpa81/System.Collections.Immutable.dll",
"lib/portable-net45+win8+wp8+wpa81/System.Collections.Immutable.xml",
"package/services/metadata/core-properties/a02fdeabe1114a24bba55860b8703852.psmdcp"
"lib/portable-net45+win8+wp8+wpa81/System.Collections.Immutable.xml"
]
},
"System.Diagnostics.Debug/4.0.0": {
"sha512": "AYJsLLGDVTC/nyURjgAo7Lpye0+HuSkcQujUf+NgQVdC/C/ky5NyamQHCforHJzgqspitMMtBe8B4UBdGXy1zQ==",
"type": "Package",
"type": "package",
"files": [
"License.rtf",
"System.Diagnostics.Debug.4.0.0.nupkg.sha512",
"System.Diagnostics.Debug.nuspec",
"[Content_Types].xml",
"_rels/.rels",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net45/_._",
......@@ -772,7 +765,6 @@
"lib/wpa81/_._",
"lib/xamarinios10/_._",
"lib/xamarinmac20/_._",
"package/services/metadata/core-properties/9589d3ad95ef4d84a1edf67426c7c00a.psmdcp",
"ref/MonoAndroid10/_._",
"ref/MonoTouch10/_._",
"ref/dotnet/System.Diagnostics.Debug.dll",
......@@ -807,12 +799,11 @@
},
"System.Globalization/4.0.0": {
"sha512": "IBJyTo1y7ZtzzoJUA60T1XPvNTyw/wfFmjFoBFtlYfkekIOtD/AzDDIg0YdUa7eNtFEfliED2R7HdppTdU4t5A==",
"type": "Package",
"type": "package",
"files": [
"License.rtf",
"System.Globalization.4.0.0.nupkg.sha512",
"System.Globalization.nuspec",
"[Content_Types].xml",
"_rels/.rels",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net45/_._",
......@@ -821,7 +812,6 @@
"lib/wpa81/_._",
"lib/xamarinios10/_._",
"lib/xamarinmac20/_._",
"package/services/metadata/core-properties/7256e6303e10459782eff20c3ec90af5.psmdcp",
"ref/MonoAndroid10/_._",
"ref/MonoTouch10/_._",
"ref/dotnet/System.Globalization.dll",
......@@ -856,18 +846,16 @@
},
"System.Linq/4.0.0": {
"sha512": "r6Hlc+ytE6m/9UBr+nNRRdoJEWjoeQiT3L3lXYFDHoXk3VYsRBCDNXrawcexw7KPLaH0zamQLiAb6avhZ50cGg==",
"type": "Package",
"type": "package",
"files": [
"System.Linq.4.0.0.nupkg.sha512",
"System.Linq.nuspec",
"[Content_Types].xml",
"_rels/.rels",
"lib/dotnet/System.Linq.dll",
"lib/net45/_._",
"lib/netcore50/System.Linq.dll",
"lib/win8/_._",
"lib/wp80/_._",
"lib/wpa81/_._",
"package/services/metadata/core-properties/6fcde56ce4094f6a8fff4b28267da532.psmdcp",
"ref/dotnet/System.Linq.dll",
"ref/dotnet/System.Linq.xml",
"ref/dotnet/de/System.Linq.xml",
......@@ -887,36 +875,32 @@
"ref/wpa81/_._"
]
},
"System.Reflection.Metadata/1.2.0-rc3-23811": {
"sha512": "gAOQV1dsGyQfQUuzsCYFLMlI6BhfK1/2aA7JGf6gJphaLgjU4dV4hzjbE0iZXgo61VUuda2LtCBrWWZBw5897Q==",
"type": "Package",
"System.Reflection.Metadata/1.2.0-rc2-23826": {
"sha512": "iaq5zpluF7mUMd5hFyhmZGyCSzF6glZjvNI2VAhLFQEp8sGA/tROj6NoZL42q6HhoHxi1XyGeoIXPi5hyw0+5w==",
"type": "package",
"files": [
"System.Reflection.Metadata.1.2.0-rc2-23826.nupkg.sha512",
"System.Reflection.Metadata.nuspec",
"ThirdPartyNotices.txt",
"[Content_Types].xml",
"_rels/.rels",
"dotnet_library_license.txt",
"lib/dotnet5.2/System.Reflection.Metadata.dll",
"lib/dotnet5.2/System.Reflection.Metadata.xml",
"lib/portable-net45+win8/System.Reflection.Metadata.dll",
"lib/portable-net45+win8/System.Reflection.Metadata.xml",
"package/services/metadata/core-properties/9aa921f066b94690988804574c5d2231.psmdcp"
"lib/portable-net45+win8/System.Reflection.Metadata.xml"
]
},
"System.Resources.ResourceManager/4.0.0": {
"sha512": "qmqeZ4BJgjfU+G2JbrZt4Dk1LsMxO4t+f/9HarNY6w8pBgweO6jT+cknUH7c3qIrGvyUqraBhU45Eo6UtA0fAw==",
"type": "Package",
"type": "package",
"files": [
"System.Resources.ResourceManager.4.0.0.nupkg.sha512",
"System.Resources.ResourceManager.nuspec",
"[Content_Types].xml",
"_rels/.rels",
"lib/DNXCore50/System.Resources.ResourceManager.dll",
"lib/net45/_._",
"lib/netcore50/System.Resources.ResourceManager.dll",
"lib/win8/_._",
"lib/wp80/_._",
"lib/wpa81/_._",
"package/services/metadata/core-properties/657a73ee3f09479c9fedb9538ade8eac.psmdcp",
"ref/dotnet/System.Resources.ResourceManager.dll",
"ref/dotnet/System.Resources.ResourceManager.xml",
"ref/dotnet/de/System.Resources.ResourceManager.xml",
......@@ -939,12 +923,11 @@
},
"System.Runtime/4.0.0": {
"sha512": "Uq9epame8hEqJlj4KaWb67dDJvj4IM37jRFGVeFbugRdPz48bR0voyBhrbf3iSa2tAmlkg4lsa6BUOL9iwlMew==",
"type": "Package",
"type": "package",
"files": [
"License.rtf",
"System.Runtime.4.0.0.nupkg.sha512",
"System.Runtime.nuspec",
"[Content_Types].xml",
"_rels/.rels",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net45/_._",
......@@ -953,7 +936,6 @@
"lib/wpa81/_._",
"lib/xamarinios10/_._",
"lib/xamarinmac20/_._",
"package/services/metadata/core-properties/c5db97a122ad42aeb8e429022c1d1ab8.psmdcp",
"ref/MonoAndroid10/_._",
"ref/MonoTouch10/_._",
"ref/dotnet/System.Runtime.dll",
......@@ -988,12 +970,11 @@
},
"System.Runtime.Extensions/4.0.0": {
"sha512": "zPzwoJcA7qar/b5Ihhzfcdr3vBOR8FIg7u//Qc5mqyAriasXuMFVraBZ5vOQq5asfun9ryNEL8Z2BOlUK5QRqA==",
"type": "Package",
"type": "package",
"files": [
"License.rtf",
"System.Runtime.Extensions.4.0.0.nupkg.sha512",
"System.Runtime.Extensions.nuspec",
"[Content_Types].xml",
"_rels/.rels",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net45/_._",
......@@ -1002,7 +983,6 @@
"lib/wpa81/_._",
"lib/xamarinios10/_._",
"lib/xamarinmac20/_._",
"package/services/metadata/core-properties/fb0a27c059094735ba8947d01a5f5660.psmdcp",
"ref/MonoAndroid10/_._",
"ref/MonoTouch10/_._",
"ref/dotnet/System.Runtime.Extensions.dll",
......@@ -1037,12 +1017,11 @@
},
"System.Threading/4.0.0": {
"sha512": "H6O/9gUrjPDNYanh/7OFGAZHjVXvEuITD0RcnjfvIV04HOGrOPqUBU0kmz9RIX/7YGgCQn1o1S2DX6Cuv8kVGQ==",
"type": "Package",
"type": "package",
"files": [
"License.rtf",
"System.Threading.4.0.0.nupkg.sha512",
"System.Threading.nuspec",
"[Content_Types].xml",
"_rels/.rels",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net45/_._",
......@@ -1051,7 +1030,6 @@
"lib/wpa81/_._",
"lib/xamarinios10/_._",
"lib/xamarinmac20/_._",
"package/services/metadata/core-properties/bec033e95dbf4d6ba6595d2be7bb7e25.psmdcp",
"ref/MonoAndroid10/_._",
"ref/MonoTouch10/_._",
"ref/dotnet/System.Threading.dll",
......
......@@ -42,7 +42,6 @@
<Compile Include="InternalUtilities\StreamExtensionsTests.cs" />
<Compile Include="InternalUtilities\StringExtensionsTests.cs" />
<Compile Include="MetadataReferences\AssemblyIdentityExtensions.cs" />
<Compile Include="MetadataReferences\AssemblyIdentityMapTests.cs" />
<Compile Include="PEWriter\BlobUtilitiesTests.cs" />
<Compile Include="PEWriter\BlobTests.cs" />
<Compile Include="PEWriter\UsedNamespaceOrTypeTests.cs" />
......
......@@ -453,7 +453,7 @@ protected override PortableExecutableReference WithPropertiesImpl(MetadataRefere
[Fact]
public void Equivalence()
{
var comparer = CommonReferenceManager<CS.CSharpCompilation, IAssemblySymbolInternal>.MetadataReferenceEqualityComparer.Instance;
var comparer = CommonReferenceManager<CS.CSharpCompilation, IAssemblySymbol>.MetadataReferenceEqualityComparer.Instance;
var f1 = MscorlibRef;
var f2 = SystemCoreRef;
......@@ -498,7 +498,7 @@ public void Equivalence()
[Fact]
public void PortableReference_Display()
{
var comparer = CommonReferenceManager<CS.CSharpCompilation, IAssemblySymbolInternal>.MetadataReferenceEqualityComparer.Instance;
var comparer = CommonReferenceManager<CS.CSharpCompilation, IAssemblySymbol>.MetadataReferenceEqualityComparer.Instance;
var f1 = MscorlibRef;
var f2 = SystemCoreRef;
......
......@@ -191,7 +191,6 @@ private sealed class ErrorAssembly : Cci.IAssemblyReference
contentType: AssemblyContentType.Default);
AssemblyIdentity Cci.IAssemblyReference.Identity => s_identity;
Version Cci.IAssemblyReference.AssemblyVersionPattern => null;
Cci.IAssemblyReference Cci.IModuleReference.GetContainingAssembly(EmitContext context)
{
......
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册