Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions DEVGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ If you are on a Mac, you can run this command from the root of the repository:
sh build.sh -c Release
```

Or if you are on Linux:

```shell
./build.sh -c Release
```

## Updating baselines in tests

Some tests use "baseline" (.bsl) files. There is sometimes a way to update these baselines en-masse in your local build,
Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,21 @@ Even if you find a single-character typo, we're happy to take the change! Althou

## Per-build NuGet packages

Per-build [versions](https://dev.azure.com/dnceng/public/_packaging?_a=package&feed=dotnet-tools&view=versions&package=FSharp.Compiler.Service&protocolType=NuGet) of our NuGet packages are available via this URL: `https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json`
### 7.0.40x series

[FSharp.Compiler.Service 43.7.400-preview](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet7/NuGet/FSharp.Compiler.Service/versions/)

```xml
<add key="fsharp-prerelease" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" />
```

### 8.0.10x series

[FSharp.Compiler.Service 43.8.100-preview](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet8/NuGet/FSharp.Compiler.Service/versions/)

```xml
<add key="fsharp-prerelease" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
```

## Branches

Expand Down
8 changes: 5 additions & 3 deletions src/Compiler/Checking/CheckDeclarations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2556,8 +2556,9 @@ module EstablishTypeDefinitionCores =
| SynModuleDecl.Types (typeSpecs, _) ->
for SynTypeDefn(typeInfo=SynComponentInfo(typeParams=synTypars; longId=ids); typeRepr=trepr) in typeSpecs do
if TyparsAllHaveMeasureDeclEarlyCheck cenv env synTypars then
match trepr with
| SynTypeDefnRepr.ObjectModel(kind=SynTypeDefnKind.Augmentation _) -> ()
match trepr, ids with
| SynTypeDefnRepr.ObjectModel(kind=SynTypeDefnKind.Augmentation _), _ -> ()
| _, [] -> ()
| _ -> yield (List.last ids).idText
| _ -> () ]
|> set
Expand Down Expand Up @@ -4831,7 +4832,8 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem
let defn = TMDefRec(true, [], [decl], binds |> List.map ModuleOrNamespaceBinding.Binding, m)
return ([defn], [], []), env, env

| SynModuleDecl.Types (typeDefs, m) ->
| SynModuleDecl.Types (typeDefs, m) ->
let typeDefs = typeDefs |> List.filter (function (SynTypeDefn(typeInfo = SynComponentInfo(longId = []))) -> false | _ -> true)
let scopem = unionRanges m scopem
let mutRecDefns = typeDefs |> List.map MutRecShape.Tycon
let mutRecDefnsChecked, envAfter = TcDeclarations.TcMutRecDefinitions cenv env parent typeNames tpenv m scopem None mutRecDefns false
Expand Down
4 changes: 2 additions & 2 deletions src/Compiler/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ parsAttributesMustComeBeforeVal,"Attributes should be placed before 'val'"
555,parsGetAndOrSetRequired,"'get' and/or 'set' required"
556,parsTypeAnnotationsOnGetSet,"Type annotations on property getters and setters must be given after the 'get()' or 'set(v)', e.g. 'with get() : string = ...'"
557,parsGetterMustHaveAtLeastOneArgument,"A getter property is expected to be a function, e.g. 'get() = ...' or 'get(index) = ...'"
558,parsMultipleAccessibilitiesForGetSet,"Multiple accessibilities given for property getter or setter"
558,parsMultipleAccessibilitiesForGetSet,"When the visibility for a property is specified, setting the visibility of the set or get method is not allowed."
559,parsSetSyntax,"Property setters must be defined using 'set value = ', 'set idx value = ' or 'set (idx1,...,idxN) value = ... '"
560,parsInterfacesHaveSameVisibilityAsEnclosingType,"Interfaces always have the same visibility as the enclosing type"
561,parsAccessibilityModsIllegalForAbstract,"Accessibility modifiers are not allowed on this member. Abstract slots always have the same visibility as the enclosing type."
Expand Down Expand Up @@ -1519,7 +1519,7 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl
3302,packageManagementRequiresVFive,"The 'package management' feature requires language version 5.0 or above"
3303,fromEndSlicingRequiresVFive,"The 'from the end slicing' feature requires language version 'preview'."
3304,poundiNotSupportedByRegisteredDependencyManagers,"#i is not supported by the registered PackageManagers"
3343,tcRequireMergeSourcesOrBindN,"The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '%s' method or appropriate 'MergeSource' and 'Bind' methods"
3343,tcRequireMergeSourcesOrBindN,"The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '%s' method or appropriate 'MergeSources' and 'Bind' methods"
3344,tcAndBangNotSupported,"This feature is not supported in this version of F#. You may need to add /langversion:preview to use this feature."
3345,tcInvalidUseBangBindingNoAndBangs,"use! may not be combined with and!"
3350,chkFeatureNotLanguageSupported,"Feature '%s' is not available in F# %s. Please use language version %s or greater."
Expand Down
5 changes: 4 additions & 1 deletion src/Compiler/SyntaxTree/LexFilter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,9 @@ type LexFilterImpl (
| CtxtSeqBlock(FirstInSeqBlock, _, _), (CtxtDo _ as limitCtxt) :: CtxtSeqBlock _ :: (CtxtTypeDefns _ | CtxtModuleBody _) :: _ ->
PositionWithColumn(limitCtxt.StartPos, limitCtxt.StartCol + 1)

| CtxtSeqBlock(FirstInSeqBlock, _, _), CtxtWithAsAugment _ :: (CtxtTypeDefns _ as limitCtxt) :: _ ->
PositionWithColumn(limitCtxt.StartPos, limitCtxt.StartCol + 1)

| _, CtxtSeqBlock _ :: rest when not strict -> undentationLimit strict rest
| _, CtxtParen _ :: rest when not strict -> undentationLimit strict rest

Expand Down Expand Up @@ -2308,7 +2311,7 @@ type LexFilterImpl (
if debug then dprintf "WITH\n"
if debug then dprintf "WITH --> NO MATCH, pushing CtxtWithAsAugment (type augmentation), stack = %A" stack
pushCtxt tokenTup (CtxtWithAsAugment tokenStartPos)
pushCtxtSeqBlock tokenTup AddBlockEnd
tryPushCtxtSeqBlock tokenTup AddBlockEnd
returnToken tokenLexbufState token

| FUNCTION, _ ->
Expand Down
7 changes: 7 additions & 0 deletions src/Compiler/SyntaxTree/SyntaxTrivia.fs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ type SynTypeDefnLeadingKeyword =
| StaticType of staticRange: range * typeRange: range
| Synthetic

member this.Range =
match this with
| SynTypeDefnLeadingKeyword.Type range
| SynTypeDefnLeadingKeyword.And range -> range
| SynTypeDefnLeadingKeyword.StaticType (staticRange, typeRange) -> Range.unionRanges staticRange typeRange
| SynTypeDefnLeadingKeyword.Synthetic -> failwith "Getting range from synthetic keyword"

[<NoEquality; NoComparison>]
type SynTypeDefnTrivia =
{
Expand Down
8 changes: 7 additions & 1 deletion src/Compiler/SyntaxTree/SyntaxTrivia.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,17 @@ type SynPatListConsTrivia =
[<NoEquality; NoComparison; RequireQualifiedAccess>]
type SynTypeDefnLeadingKeyword =
| Type of range

| And of range
// Can happen in SynMemberDefn.NestedType or SynMemberSig.NestedType

/// Can happen in SynMemberDefn.NestedType or SynMemberSig.NestedType
| StaticType of staticRange: range * typeRange: range

/// Produced during type checking, should not be used in actual parsed trees.
| Synthetic

member Range: range

/// Represents additional information for SynTypeDefn
[<NoEquality; NoComparison>]
type SynTypeDefnTrivia =
Expand Down
22 changes: 18 additions & 4 deletions src/Compiler/pars.fsy
Original file line number Diff line number Diff line change
Expand Up @@ -527,13 +527,22 @@ moduleIntro:
let mModule = rhs parseState 1
mModule, $4, [], $3, $2 }

| moduleKeyword opt_attributes opt_access opt_rec recover
{ if not (isNil $2) then
parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AttributesToRightOfModuleKeyword (rhs parseState 4)
let mModule = rhs parseState 1
mModule, $4, [], $3, $2 }

/* The start of a namespace declaration */
namespaceIntro:
| NAMESPACE opt_rec path
{ let mNamespace = rhs parseState 1
mNamespace, $2, $3.LongIdent, grabXmlDoc(parseState, [], 1) }

| NAMESPACE opt_rec recover
{ let mNamespace = rhs parseState 1
mNamespace, $2, [], grabXmlDoc(parseState, [], 1) }


/* The contents of a signature file */
fileNamespaceSpecs:
Expand Down Expand Up @@ -1138,8 +1147,8 @@ fileModuleImpl:
| moduleDefnsOrExprPossiblyEmptyOrBlock
{ let m = (rhs parseState 1)
(fun (mNamespaceOpt, isRec, path, xml) ->
match path with
| [] -> ParsedImplFileFragment.AnonModule($1, m)
match path, mNamespaceOpt with
| [], None -> ParsedImplFileFragment.AnonModule($1, m)
| _ ->
let lastDeclRange = List.tryLast $1 |> Option.map (fun decl -> decl.Range) |> Option.defaultValue (rhs parseState 1)
let m = mkRange lastDeclRange.FileName (lhs parseState).Start lastDeclRange.End
Expand Down Expand Up @@ -1540,7 +1549,8 @@ typeNameInfo:
| opt_attributes tyconNameAndTyparDecls opt_typeConstraints
{ let typars, lid, fixity, vis = $2
let xmlDoc = grabXmlDoc(parseState, $1, 1)
SynComponentInfo ($1, typars, $3, lid, xmlDoc, fixity, vis, rangeOfLid lid) }
let m = match lid with [] -> rhs parseState 2 | _ -> rangeOfLid lid
SynComponentInfo ($1, typars, $3, lid, xmlDoc, fixity, vis, m) }

/* Part of a set of type definitions */
tyconDefnList:
Expand Down Expand Up @@ -1604,7 +1614,8 @@ tyconDefn:
let mEquals = rhs parseState 7
// Gets the XML doc comments prior to the implicit constructor
let xmlDoc = grabXmlDoc(parseState, $2, 2)
let memberCtorPattern = SynMemberDefn.ImplicitCtor(vis, $2, spats, Option.map snd az, xmlDoc, rangeOfLid lid, { AsKeyword = Option.map fst az })
let m = match lid with [] -> rhs parseState 1 | _ -> rangeOfLid lid
let memberCtorPattern = SynMemberDefn.ImplicitCtor(vis, $2, spats, Option.map snd az, xmlDoc, m, { AsKeyword = Option.map fst az })
let tcDefRepr =
match tcDefRepr with
| SynTypeDefnRepr.ObjectModel (k, cspec, m) -> SynTypeDefnRepr.ObjectModel(k, memberCtorPattern :: cspec, m)
Expand Down Expand Up @@ -2317,6 +2328,9 @@ tyconNameAndTyparDecls:
| opt_access path postfixTyparDecls
{ Some $3, $2.LongIdent, true, $1 }

| opt_access recover
{ None, [], false, $1 }

prefixTyparDecls:
| typar
{ SynTyparDecls.SinglePrefix(SynTyparDecl([], $1), rhs parseState 1) }
Expand Down
8 changes: 4 additions & 4 deletions src/Compiler/xlf/FSComp.txt.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1153,8 +1153,8 @@
<note />
</trans-unit>
<trans-unit id="tcRequireMergeSourcesOrBindN">
<source>The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSource' and 'Bind' methods</source>
<target state="translated">Konstrukt let! ... and! ... se dá použít jen v případě, že tvůrce výpočetních výrazů definuje buď metodu {0}, nebo vhodné metody MergeSource a Bind.</target>
<source>The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSources' and 'Bind' methods</source>
<target state="needs-review-translation">Konstrukt let! ... and! ... se dá použít jen v případě, že tvůrce výpočetních výrazů definuje buď metodu {0}, nebo vhodné metody MergeSource a Bind.</target>
<note />
</trans-unit>
<trans-unit id="tcResumableCodeArgMustHaveRightKind">
Expand Down Expand Up @@ -3283,8 +3283,8 @@
<note />
</trans-unit>
<trans-unit id="parsMultipleAccessibilitiesForGetSet">
<source>Multiple accessibilities given for property getter or setter</source>
<target state="translated">Zadali jste víc dostupností pro metodu getter nebo setter vlastnosti.</target>
<source>When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.</source>
<target state="needs-review-translation">Zadali jste víc dostupností pro metodu getter nebo setter vlastnosti.</target>
<note />
</trans-unit>
<trans-unit id="parsSetSyntax">
Expand Down
8 changes: 4 additions & 4 deletions src/Compiler/xlf/FSComp.txt.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1153,8 +1153,8 @@
<note />
</trans-unit>
<trans-unit id="tcRequireMergeSourcesOrBindN">
<source>The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSource' and 'Bind' methods</source>
<target state="translated">Das Konstrukt "let! ... and! ..." kann nur verwendet werden, wenn der Berechnungsausdrucks-Generator entweder eine {0}-Methode oder geeignete MergeSource- und Bind-Methoden definiert.</target>
<source>The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSources' and 'Bind' methods</source>
<target state="needs-review-translation">Das Konstrukt "let! ... and! ..." kann nur verwendet werden, wenn der Berechnungsausdrucks-Generator entweder eine {0}-Methode oder geeignete MergeSource- und Bind-Methoden definiert.</target>
<note />
</trans-unit>
<trans-unit id="tcResumableCodeArgMustHaveRightKind">
Expand Down Expand Up @@ -3283,8 +3283,8 @@
<note />
</trans-unit>
<trans-unit id="parsMultipleAccessibilitiesForGetSet">
<source>Multiple accessibilities given for property getter or setter</source>
<target state="translated">Für den Getter oder Setter der Eigenschaft wurden mehrere Zugriffsebenen angegeben.</target>
<source>When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.</source>
<target state="needs-review-translation">Für den Getter oder Setter der Eigenschaft wurden mehrere Zugriffsebenen angegeben.</target>
<note />
</trans-unit>
<trans-unit id="parsSetSyntax">
Expand Down
8 changes: 4 additions & 4 deletions src/Compiler/xlf/FSComp.txt.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1153,8 +1153,8 @@
<note />
</trans-unit>
<trans-unit id="tcRequireMergeSourcesOrBindN">
<source>The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSource' and 'Bind' methods</source>
<target state="translated">La construcción "let! ... and! ..." solo se puede usar si el generador de expresiones de cálculo define un método "{0}" o bien los métodos "MergeSource" y "Bind" adecuados.</target>
<source>The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSources' and 'Bind' methods</source>
<target state="needs-review-translation">La construcción "let! ... and! ..." solo se puede usar si el generador de expresiones de cálculo define un método "{0}" o bien los métodos "MergeSource" y "Bind" adecuados.</target>
<note />
</trans-unit>
<trans-unit id="tcResumableCodeArgMustHaveRightKind">
Expand Down Expand Up @@ -3283,8 +3283,8 @@
<note />
</trans-unit>
<trans-unit id="parsMultipleAccessibilitiesForGetSet">
<source>Multiple accessibilities given for property getter or setter</source>
<target state="translated">Se proporcionaron varias accesibilidades para un captador o establecedor de propiedad.</target>
<source>When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.</source>
<target state="needs-review-translation">Se proporcionaron varias accesibilidades para un captador o establecedor de propiedad.</target>
<note />
</trans-unit>
<trans-unit id="parsSetSyntax">
Expand Down
8 changes: 4 additions & 4 deletions src/Compiler/xlf/FSComp.txt.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1153,8 +1153,8 @@
<note />
</trans-unit>
<trans-unit id="tcRequireMergeSourcesOrBindN">
<source>The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSource' and 'Bind' methods</source>
<target state="translated">La construction 'let! ... and! ...' peut uniquement être utilisée si le générateur d'expressions de calcul définit une méthode '{0}' ou les méthodes 'MergeSource' et 'Bind' appropriées</target>
<source>The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSources' and 'Bind' methods</source>
<target state="needs-review-translation">La construction 'let! ... and! ...' peut uniquement être utilisée si le générateur d'expressions de calcul définit une méthode '{0}' ou les méthodes 'MergeSource' et 'Bind' appropriées</target>
<note />
</trans-unit>
<trans-unit id="tcResumableCodeArgMustHaveRightKind">
Expand Down Expand Up @@ -3283,8 +3283,8 @@
<note />
</trans-unit>
<trans-unit id="parsMultipleAccessibilitiesForGetSet">
<source>Multiple accessibilities given for property getter or setter</source>
<target state="translated">Plusieurs accessibilités fournies pour la méthode getter ou setter de la propriété</target>
<source>When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.</source>
<target state="needs-review-translation">Plusieurs accessibilités fournies pour la méthode getter ou setter de la propriété</target>
<note />
</trans-unit>
<trans-unit id="parsSetSyntax">
Expand Down
8 changes: 4 additions & 4 deletions src/Compiler/xlf/FSComp.txt.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1153,8 +1153,8 @@
<note />
</trans-unit>
<trans-unit id="tcRequireMergeSourcesOrBindN">
<source>The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSource' and 'Bind' methods</source>
<target state="translated">È possibile usare il costrutto 'let! ... and! ...' solo se il generatore di espressioni di calcolo definisce un metodo '{0}' o metodi 'MergeSource' e 'Bind' appropriati</target>
<source>The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '{0}' method or appropriate 'MergeSources' and 'Bind' methods</source>
<target state="needs-review-translation">È possibile usare il costrutto 'let! ... and! ...' solo se il generatore di espressioni di calcolo definisce un metodo '{0}' o metodi 'MergeSource' e 'Bind' appropriati</target>
<note />
</trans-unit>
<trans-unit id="tcResumableCodeArgMustHaveRightKind">
Expand Down Expand Up @@ -3283,8 +3283,8 @@
<note />
</trans-unit>
<trans-unit id="parsMultipleAccessibilitiesForGetSet">
<source>Multiple accessibilities given for property getter or setter</source>
<target state="translated">Sono state assegnate più accessibilità per il getter o il setter della proprietà</target>
<source>When the visibility for a property is specified, setting the visibility of the set or get method is not allowed.</source>
<target state="needs-review-translation">Sono state assegnate più accessibilità per il getter o il setter della proprietà</target>
<note />
</trans-unit>
<trans-unit id="parsSetSyntax">
Expand Down
Loading