Skip to content

Commit

Permalink
Better way of checking for the deterministic flag
Browse files Browse the repository at this point in the history
  • Loading branch information
TyOverby committed Sep 22, 2015
1 parent ab4f4c4 commit 821de3c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2073,8 +2073,7 @@ private void DecodeWellKnownAttribute(ref DecodeWellKnownAttributeArguments<Attr
{
string verString = (string)attribute.CommonConstructorArguments[0].Value;
Version version;
bool deterministic = _compilation.Feature("deterministic")?.Equals("true", StringComparison.OrdinalIgnoreCase) ?? false;
if (!VersionHelper.TryParseAssemblyVersion(verString, allowWildcard: !deterministic, version: out version))
if (!VersionHelper.TryParseAssemblyVersion(verString, allowWildcard: !_compilation.IsEmitDeterministic, version: out version))
{
Location attributeArgumentSyntaxLocation = attribute.GetAttributeArgumentSyntaxLocation(0, arguments.AttributeSyntaxOpt);
arguments.Diagnostics.Add(ErrorCode.ERR_InvalidVersionFormat, attributeArgumentSyntaxLocation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -998,8 +998,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
ElseIf attrData.IsTargetAttribute(Me, AttributeDescription.AssemblyVersionAttribute) Then
Dim verString = DirectCast(attrData.CommonConstructorArguments(0).Value, String)
Dim version As Version = Nothing
Dim deterministic As Boolean = If(_compilation.Feature("deterministic")?.Equals("true", StringComparison.OrdinalIgnoreCase), False)
If Not VersionHelper.TryParseAssemblyVersion(verString, allowWildcard:=Not deterministic, version:=version) Then
If Not VersionHelper.TryParseAssemblyVersion(verString, allowWildcard:=Not _compilation.IsEmitDeterministic, version:=version) Then
arguments.Diagnostics.Add(ERRID.ERR_InvalidVersionFormat, GetAssemblyAttributeFirstArgumentLocation(arguments.AttributeSyntaxOpt))
End If
arguments.GetOrCreateData(Of CommonAssemblyWellKnownAttributeData)().AssemblyVersionAttributeSetting = version
Expand Down

0 comments on commit 821de3c

Please sign in to comment.