Skip to content

Commit

Permalink
Merge pull request mono#3780 from akoeplinger/mcs-error-constant-inva…
Browse files Browse the repository at this point in the history
…riant

[mcs] Use InvariantCulture for GetValueAsLiteral() in constant.cs
  • Loading branch information
marek-safar authored Oct 18, 2016
2 parents e863f9c + 51245ed commit 03356ab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mcs/mcs/constant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ public override void Error_ValueCannotBeConverted (ResolveContext ec, TypeSpec t
catch
{
ec.Report.Error (31, loc, "Constant value `{0}' cannot be converted to a `{1}'",
GetValue ().ToString (), target.GetSignatureForError ());
GetValueAsLiteral (), target.GetSignatureForError ());
}
}

Expand Down Expand Up @@ -1697,7 +1697,7 @@ public override object GetValue ()

public override string GetValueAsLiteral ()
{
return Value.ToString ();
return Value.ToString (CultureInfo.InvariantCulture);
}

public override long GetValueAsLong ()
Expand Down Expand Up @@ -1820,7 +1820,7 @@ public override object GetValue ()

public override string GetValueAsLiteral ()
{
return Value.ToString ();
return Value.ToString (CultureInfo.InvariantCulture);
}

public override long GetValueAsLong ()
Expand Down Expand Up @@ -2021,7 +2021,7 @@ public override object GetValue ()

public override string GetValueAsLiteral ()
{
return Value.ToString () + "M";
return Value.ToString (CultureInfo.InvariantCulture) + "M";
}

public override long GetValueAsLong ()
Expand Down

0 comments on commit 03356ab

Please sign in to comment.