Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
2 contributors

Users who have contributed to this file

@voronoipotato @dsyme
74 lines (53 sloc) 1.71 KB

F# RFC FS-1070 - Offside relaxations for constructors and members

The design suggestion Allow undentation for constructors has been marked "approved in principle". This RFC covers the detailed proposal for this suggestion and some related design relaxations.

Summary

F#'s indentation rules are overly stringent for the argument lists of implicit constructors and static methods. This relaxs the rules for these cases by adding some permitted "undentations".

Code Examples

For example, currently these all give a indentation warnings:

type OffsideCheck(a:int,
        b:int, c:int,  // warning offside of '('
        d:int) =

and:

type OffsideCheck(a:int,
   b:int, c:int,  // warning offside of '('
   d:int) =

and:

    static member M(a:int,
        b:int, c:int, // warning offside of 'member'
        d:int) = 1

and:

type C() = 
    static member P with get() = 
      1 // warning -- offside of 'member'

In all the above cases an andentation is added.

Detailed Design

TBD. Each newly permitted undenation is declarative in the implementation, and simply needs to be translated into the terminology used in the F# language spec.

Code samples

See above

Drawbacks

None

Alternatives

The main alternative is "don't do this" and continue to require indentation.

Compatibility

This is a non-breaking change.

Unresolved questions

None

You can’t perform that action at this time.