Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Something doesn't add up in fix for 303 #1093

Closed
3 tasks
nojaf opened this issue Sep 4, 2020 · 1 comment
Closed
3 tasks

Something doesn't add up in fix for 303 #1093

nojaf opened this issue Sep 4, 2020 · 1 comment

Comments

@nojaf
Copy link
Contributor

nojaf commented Sep 4, 2020

Issue created from fantomas-online

Code

  let internal UpdateStrongNaming (assembly : AssemblyDefinition) (key : StrongNameKeyPair option) =
    let assemblyName = assembly.Name
#if NETCOREAPP2_0
    do
#else
    match key with
    | None ->
#endif
              assembly.MainModule.Attributes <- assembly.MainModule.Attributes &&& (~~~ModuleAttributes.StrongNameSigned)
              assemblyName.HasPublicKey <- false
              assemblyName.PublicKey <- null
              assemblyName.PublicKeyToken <- null
#if NETCOREAPP2_0
#else
    | Some key' -> assemblyName.HasPublicKey <- true
                   assemblyName.PublicKey <- key'.PublicKey // sets token implicitly
#endif

Result

let internal UpdateStrongNaming (assembly: AssemblyDefinition) (key: StrongNameKeyPair option) =
    let assemblyName = assembly.Name
#if NETCOREAPP2_0
#else
    match key with
    | None ->
#endif
    do assembly.MainModule.Attributes <-
        assembly.MainModule.Attributes
        &&& (~~~ModuleAttributes.StrongNameSigned)

       assemblyName.HasPublicKey <- false
       assemblyName.PublicKey <- null
       assemblyName.PublicKeyToken <- null
#if NETCOREAPP2_0
#else
    | Some key' ->
        assemblyName.HasPublicKey <- true
        assemblyName.PublicKey <- key'.PublicKey // sets token implicitly
#endif

Problem description

This was reported in #303 but when formatting the result code again, something goes wrong...

Extra information

  • The formatted result breaks by code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.

Options

Fantomas Master at 09/04/2020 11:05:32 - d3828b0

Default Fantomas configuration

@nojaf
Copy link
Contributor Author

nojaf commented Nov 14, 2020

This was fixed in #1240.

@nojaf nojaf closed this as completed Nov 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant