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

Calls to constructor from inherited class leads to wrong indentation (breaks build) #326

Closed
danyx23 opened this issue Oct 14, 2018 · 0 comments

Comments

@danyx23
Copy link
Contributor

danyx23 commented Oct 14, 2018

The text below leads to output like this (note the last two lines where a semicolon is inserted and the rest of the implementation wrongly indented):

namespace MBrace.FsPickler

[<AutoSerializable(false)>]
type internal CompositePickler<'T> =
    inherit Pickler<'T>
    private new(reader, writer, cloner, accepter, nested : Pickler option, 
                picklerInfo, ?cacheByRef, ?useWithSubtypes, ?skipHeaderWrite, 
                ?bypass, ?skipVisit, ?isCloneableOnly) =
        { inherit Pickler<'T>(); m_IsInitialized = true
                                 m_NestedPickler = nested

Test function:

let ``inherit call to base class constructor``() =
    formatSourceString false """namespace MBrace.FsPickler

[<AutoSerializable(false)>]
type internal CompositePickler<'T> =
    inherit Pickler<'T>

    private new(reader, writer, cloner, accepter, nested : Pickler option,
                picklerInfo, ?cacheByRef, ?useWithSubtypes, ?skipHeaderWrite,
                ?bypass, ?skipVisit, ?isCloneableOnly) =
        { inherit Pickler<'T>()
          m_IsInitialized = true
          m_NestedPickler = nested
          m_Writer = writer
          m_Reader = reader
          m_Cloner = cloner
          m_Accepter = accepter
          m_PicklerInfo = picklerInfo
          m_IsCacheByRef =
             match cacheByRef with
             | Some c -> c || base.IsRecursiveType
             | None -> base.Kind > Kind.String
          m_UseWithSubtypes =
             defaultArg useWithSubtypes false
          m_SkipHeaderWrite =
             defaultArg skipHeaderWrite false
          m_Bypass = defaultArg bypass false
          m_SkipVisit = defaultArg skipVisit false
          m_IsCloneableOnly =
             defaultArg isCloneableOnly false }
"""  config
    |> should equal """namespace MBrace.FsPickler

[<AutoSerializable(false)>]
type internal CompositePickler<'T> =
    inherit Pickler<'T>
    private new(reader, writer, cloner, accepter, nested : Pickler option,
                picklerInfo, ?cacheByRef, ?useWithSubtypes, ?skipHeaderWrite,
                ?bypass, ?skipVisit, ?isCloneableOnly) =
        { inherit Pickler<'T>()
          m_IsInitialized = true
          m_NestedPickler = nested
          m_Writer = writer
          m_Reader = reader
          m_Cloner = cloner
          m_Accepter = accepter
          m_PicklerInfo = picklerInfo
          m_IsCacheByRef =
              match cacheByRef with
              | Some c -> c || base.IsRecursiveType
              | None -> base.Kind > Kind.String
          m_UseWithSubtypes = defaultArg useWithSubtypes false
          m_SkipHeaderWrite = defaultArg skipHeaderWrite false
          m_Bypass = defaultArg bypass false
          m_SkipVisit = defaultArg skipVisit false
          m_IsCloneableOnly = defaultArg isCloneableOnly false }
"""
jindraivanek added a commit to jindraivanek/fantomas that referenced this issue Feb 14, 2019
@jindraivanek jindraivanek mentioned this issue Feb 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants