diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md
index b906a5ffec9..c0c5b75b958 100644
--- a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md
+++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md
@@ -25,5 +25,6 @@
* Better ranges for CE `use` error reporting. ([PR #17811](https://github.com/dotnet/fsharp/pull/17811))
* Better ranges for `inherit` error reporting. ([PR #17879](https://github.com/dotnet/fsharp/pull/17879))
* Better ranges for `inherit` `struct` error reporting. ([PR #17886](https://github.com/dotnet/fsharp/pull/17886))
+* Better ranges for `inherit` objects error reporting. ([PR #17893](https://github.com/dotnet/fsharp/pull/17893))
### Breaking Changes
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 19118639aa2..ec75e2b3ec2 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -52,25 +52,25 @@
91b9734abbad751d575c002b30778c88d978993c
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-optimization
- 15f6d606bfc7cbb65587dd7bc1ec6e9ef283f7e3
+ 9d7532585ce71e30ab55f0364d3cecccaf0775d1
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-optimization
- 15f6d606bfc7cbb65587dd7bc1ec6e9ef283f7e3
+ 9d7532585ce71e30ab55f0364d3cecccaf0775d1
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-optimization
- 15f6d606bfc7cbb65587dd7bc1ec6e9ef283f7e3
+ 9d7532585ce71e30ab55f0364d3cecccaf0775d1
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-optimization
- 15f6d606bfc7cbb65587dd7bc1ec6e9ef283f7e3
+ 9d7532585ce71e30ab55f0364d3cecccaf0775d1
-
+
https://dev.azure.com/dnceng/internal/_git/dotnet-optimization
- 15f6d606bfc7cbb65587dd7bc1ec6e9ef283f7e3
+ 9d7532585ce71e30ab55f0364d3cecccaf0775d1
diff --git a/eng/Versions.props b/eng/Versions.props
index 4252f548c66..658ed0f5d9e 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -196,10 +196,10 @@
2.2.0
- 1.0.0-prerelease.23614.4
- 1.0.0-prerelease.23614.4
- 1.0.0-prerelease.23614.4
- 1.0.0-prerelease.23614.4
- 1.0.0-prerelease.23614.4
+ 1.0.0-prerelease.24462.2
+ 1.0.0-prerelease.24462.2
+ 1.0.0-prerelease.24462.2
+ 1.0.0-prerelease.24462.2
+ 1.0.0-prerelease.24462.2
diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs
index a3dc4998630..80c1a656c2d 100644
--- a/src/Compiler/Checking/CheckDeclarations.fs
+++ b/src/Compiler/Checking/CheckDeclarations.fs
@@ -1090,7 +1090,7 @@ module MutRecBindingChecking =
[Phase2AIncrClassCtor (staticCtorInfo, Some incrCtorInfo)], innerState
- | Some (SynMemberDefn.ImplicitInherit (ty, arg, _baseIdOpt, m)), _ ->
+ | Some (SynMemberDefn.ImplicitInherit (ty, arg, _baseIdOpt, m, _)), _ ->
if tcref.TypeOrMeasureKind = TyparKind.Measure then
error(Error(FSComp.SR.tcMeasureDeclarationsRequireStaticMembers(), m))
@@ -3324,7 +3324,6 @@ module EstablishTypeDefinitionCores =
else None
| SynTypeDefnSimpleRepr.General (kind, inherits, slotsigs, fields, isConcrete, _, _, _) ->
let kind = InferTyconKind g (kind, attrs, slotsigs, fields, inSig, isConcrete, m)
-
match inheritedTys with
| [] ->
match kind with
@@ -3335,9 +3334,9 @@ module EstablishTypeDefinitionCores =
| [(ty, m)] ->
let inheritRange =
- match inherits with
- | [] -> m
- | (synType, _, _) :: _ -> synType.Range
+ match inherits with
+ | [] -> m
+ | (synType, _, _) :: _ -> synType.Range
if not firstPass && not (match kind with SynTypeDefnKind.Class -> true | _ -> false) then
errorR (Error(FSComp.SR.tcStructsInterfacesEnumsDelegatesMayNotInheritFromOtherTypes(), inheritRange))
CheckSuperType cenv ty inheritRange
@@ -3345,11 +3344,15 @@ module EstablishTypeDefinitionCores =
if firstPass then
errorR(Error(FSComp.SR.tcCannotInheritFromVariableType(), inheritRange))
Some g.obj_ty_noNulls // a "super" that is a variable type causes grief later
- else
-
+ else
Some ty
- | _ ->
- error(Error(FSComp.SR.tcTypesCannotInheritFromMultipleConcreteTypes(), m))
+ | _ ->
+ match inherits with
+ | [] -> ()
+ | _ :: inherits ->
+ for synType, _, _ in inherits do
+ errorR(Error(FSComp.SR.tcTypesCannotInheritFromMultipleConcreteTypes(), synType.Range))
+ None
| SynTypeDefnSimpleRepr.Enum _ ->
Some(g.system_Enum_ty)
@@ -4278,7 +4281,7 @@ module TcDeclarations =
// multiple (binding or slotsig or field or interface or inherit).
// i.e. not local-bindings, implicit ctor or implicit inherit (or tycon?).
// atMostOne inherit.
- let private CheckMembersForm ds =
+ let private CheckMembersForm ds m =
match ds with
| d :: ds when isImplicitCtor d ->
// Implicit construction
@@ -4290,7 +4293,7 @@ module TcDeclarations =
// Skip over 'let' and 'do' bindings
let _, ds = ds |> List.takeUntil (function SynMemberDefn.LetBindings _ -> false | _ -> true)
- // Skip over 'let' and 'do' bindings
+ // Skip over member bindings, abstract slots, interfaces and auto properties
let _, ds = ds |> List.takeUntil (allFalse [isMember;isAbstractSlot;isInterface;isAutoProperty])
match ds with
@@ -4299,7 +4302,7 @@ module TcDeclarations =
| SynMemberDefn.Interface (range=m) :: _ -> errorR(InternalError("List.takeUntil is wrong, have interface", m))
| SynMemberDefn.ImplicitCtor (range=m) :: _ -> errorR(InternalError("implicit class construction with two implicit constructions", m))
| SynMemberDefn.AutoProperty (range=m) :: _ -> errorR(InternalError("List.takeUntil is wrong, have auto property", m))
- | SynMemberDefn.ImplicitInherit (range=m) :: _ -> errorR(Error(FSComp.SR.tcTypeDefinitionsWithImplicitConstructionMustHaveOneInherit(), m))
+ | SynMemberDefn.ImplicitInherit _ :: _ -> errorR(Error(FSComp.SR.tcTypeDefinitionsWithImplicitConstructionMustHaveOneInherit(), m))
| SynMemberDefn.LetBindings (range=m) :: _ -> errorR(Error(FSComp.SR.tcTypeDefinitionsWithImplicitConstructionMustHaveLocalBindingsBeforeMembers(), m))
| SynMemberDefn.Inherit (trivia= { InheritKeyword = m }) :: _ -> errorR(Error(FSComp.SR.tcInheritDeclarationMissingArguments(), m))
| SynMemberDefn.NestedType (range=m) :: _ -> errorR(Error(FSComp.SR.tcTypesCannotContainNestedTypes(), m))
@@ -4467,14 +4470,14 @@ module TcDeclarations =
| SynTypeDefnRepr.ObjectModel(kind, members, m) ->
let members = desugarGetSetMembers members
- CheckMembersForm members
+ CheckMembersForm members synTyconInfo.Range
let fields = members |> List.choose (function SynMemberDefn.ValField (fieldInfo = f) -> Some f | _ -> None)
let implements2 = members |> List.choose (function SynMemberDefn.Interface (interfaceType=ty) -> Some(ty, ty.Range) | _ -> None)
let inherits =
members |> List.choose (function
| SynMemberDefn.Inherit (Some ty, idOpt, m, _) -> Some(ty, m, idOpt)
- | SynMemberDefn.ImplicitInherit (ty, _, idOpt, m) -> Some(ty, m, idOpt)
+ | SynMemberDefn.ImplicitInherit (ty, _, idOpt, m, _) -> Some(ty, m, idOpt)
| _ -> None)
//let nestedTycons = cspec |> List.choose (function SynMemberDefn.NestedType (x, _, _) -> Some x | _ -> None)
diff --git a/src/Compiler/Driver/GraphChecking/FileContentMapping.fs b/src/Compiler/Driver/GraphChecking/FileContentMapping.fs
index 0534c00feb4..7be965522f6 100644
--- a/src/Compiler/Driver/GraphChecking/FileContentMapping.fs
+++ b/src/Compiler/Driver/GraphChecking/FileContentMapping.fs
@@ -212,7 +212,7 @@ let visitSynMemberDefn (md: SynMemberDefn) : FileContentEntry list =
yield! collectFromOption visitBinding memberDefnForGet
yield! collectFromOption visitBinding memberDefnForSet
| SynMemberDefn.ImplicitCtor(ctorArgs = pat) -> yield! visitPat pat
- | SynMemberDefn.ImplicitInherit(inheritType, inheritArgs, _, _) ->
+ | SynMemberDefn.ImplicitInherit(inheritType, inheritArgs, _, _, _) ->
yield! visitSynType inheritType
yield! visitSynExpr inheritArgs
| SynMemberDefn.LetBindings(bindings = bindings) -> yield! List.collect visitBinding bindings
diff --git a/src/Compiler/Driver/GraphChecking/GraphProcessing.fs b/src/Compiler/Driver/GraphChecking/GraphProcessing.fs
index 218c9d6b2ac..33dd1c42c46 100644
--- a/src/Compiler/Driver/GraphChecking/GraphProcessing.fs
+++ b/src/Compiler/Driver/GraphChecking/GraphProcessing.fs
@@ -252,6 +252,7 @@ let processGraphAsync<'Item, 'Result when 'Item: equality and 'Item: comparison>
let rec queueNode node =
Async.Start(
async {
+ use! _catch = Async.OnCancel(completionSignal.TrySetCanceled >> ignore)
let! res = processNode node |> Async.Catch
match res with
diff --git a/src/Compiler/Service/FSharpParseFileResults.fs b/src/Compiler/Service/FSharpParseFileResults.fs
index 7b273f71430..612057578f7 100644
--- a/src/Compiler/Service/FSharpParseFileResults.fs
+++ b/src/Compiler/Service/FSharpParseFileResults.fs
@@ -817,7 +817,7 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput,
| SynMemberDefn.Inherit(range = m) ->
// can break on the "inherit" clause
yield! checkRange m
- | SynMemberDefn.ImplicitInherit(_, arg, _, m) ->
+ | SynMemberDefn.ImplicitInherit(_, arg, _, m, _) ->
// can break on the "inherit" clause
yield! checkRange m
yield! walkExpr true arg
diff --git a/src/Compiler/Service/ServiceInterfaceStubGenerator.fs b/src/Compiler/Service/ServiceInterfaceStubGenerator.fs
index f0ddc777b14..fb3e8dfbecc 100644
--- a/src/Compiler/Service/ServiceInterfaceStubGenerator.fs
+++ b/src/Compiler/Service/ServiceInterfaceStubGenerator.fs
@@ -825,7 +825,7 @@ module InterfaceStubGenerator =
| SynMemberDefn.Open _
| SynMemberDefn.ImplicitCtor _
| SynMemberDefn.Inherit _ -> None
- | SynMemberDefn.ImplicitInherit(_, expr, _, _) -> walkExpr expr
+ | SynMemberDefn.ImplicitInherit(_, expr, _, _, _) -> walkExpr expr
and walkBinding (SynBinding(expr = expr)) = walkExpr expr
diff --git a/src/Compiler/Service/ServiceParseTreeWalk.fs b/src/Compiler/Service/ServiceParseTreeWalk.fs
index 433142e5105..4c55c78a437 100644
--- a/src/Compiler/Service/ServiceParseTreeWalk.fs
+++ b/src/Compiler/Service/ServiceParseTreeWalk.fs
@@ -958,7 +958,7 @@ module SyntaxTraversal =
| SynMemberDefn.ImplicitCtor(ctorArgs = pat) -> traverseSynSimplePats path pat
- | SynMemberDefn.ImplicitInherit(synType, synExpr, _identOption, range) ->
+ | SynMemberDefn.ImplicitInherit(synType, synExpr, _identOption, range, _) ->
[
dive () synType.Range (fun () ->
match traverseInherit (synType, range) with
diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs
index 3be806eaa9f..2ed457116b6 100644
--- a/src/Compiler/Service/ServiceParsedInputOps.fs
+++ b/src/Compiler/Service/ServiceParsedInputOps.fs
@@ -905,7 +905,7 @@ module ParsedInput =
| SynMemberDefn.ImplicitCtor(attributes = Attributes attrs; ctorArgs = pat) ->
List.tryPick walkAttribute attrs |> Option.orElseWith (fun _ -> walkPat pat)
- | SynMemberDefn.ImplicitInherit(t, e, _, _) -> walkType t |> Option.orElseWith (fun () -> walkExpr e)
+ | SynMemberDefn.ImplicitInherit(t, e, _, _, _) -> walkType t |> Option.orElseWith (fun () -> walkExpr e)
| SynMemberDefn.LetBindings(bindings, _, _, _) -> List.tryPick walkBinding bindings
@@ -2233,7 +2233,7 @@ module ParsedInput =
| SynMemberDefn.ImplicitCtor(attributes = Attributes attrs; ctorArgs = pat) ->
List.iter walkAttribute attrs
walkPat pat
- | SynMemberDefn.ImplicitInherit(t, e, _, _) ->
+ | SynMemberDefn.ImplicitInherit(t, e, _, _, _) ->
walkType t
walkExpr e
| SynMemberDefn.LetBindings(bindings, _, _, _) -> List.iter walkBinding bindings
diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs
index a30ea5d811b..d0c39dc1494 100644
--- a/src/Compiler/SyntaxTree/SyntaxTree.fs
+++ b/src/Compiler/SyntaxTree/SyntaxTree.fs
@@ -1488,7 +1488,12 @@ type SynMemberDefn =
range: range *
trivia: SynMemberDefnImplicitCtorTrivia
- | ImplicitInherit of inheritType: SynType * inheritArgs: SynExpr * inheritAlias: Ident option * range: range
+ | ImplicitInherit of
+ inheritType: SynType *
+ inheritArgs: SynExpr *
+ inheritAlias: Ident option *
+ range: range *
+ trivia: SynMemberDefnInheritTrivia
| LetBindings of bindings: SynBinding list * isStatic: bool * isRecursive: bool * range: range
diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi
index b63979ce3fc..0b24535623b 100644
--- a/src/Compiler/SyntaxTree/SyntaxTree.fsi
+++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi
@@ -1654,7 +1654,12 @@ type SynMemberDefn =
trivia: SynMemberDefnImplicitCtorTrivia
/// An implicit inherit definition, 'inherit (args...) as base'
- | ImplicitInherit of inheritType: SynType * inheritArgs: SynExpr * inheritAlias: Ident option * range: range
+ | ImplicitInherit of
+ inheritType: SynType *
+ inheritArgs: SynExpr *
+ inheritAlias: Ident option *
+ range: range *
+ trivia: SynMemberDefnInheritTrivia
/// A 'let' definition within a class
| LetBindings of bindings: SynBinding list * isStatic: bool * isRecursive: bool * range: range
diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy
index 0e56092fe54..b21a51d345c 100644
--- a/src/Compiler/pars.fsy
+++ b/src/Compiler/pars.fsy
@@ -2328,7 +2328,8 @@ inheritsDefn:
| INHERIT atomTypeNonAtomicDeprecated opt_HIGH_PRECEDENCE_APP atomicExprAfterType optBaseSpec
{ let mDecl = unionRanges (rhs parseState 1) $4.Range
- SynMemberDefn.ImplicitInherit($2, $4, $5, mDecl) }
+ let trivia = { InheritKeyword = rhs parseState 1 }
+ SynMemberDefn.ImplicitInherit($2, $4, $5, mDecl, trivia) }
| INHERIT ends_coming_soon_or_recover
{ let mDecl = (rhs parseState 1)
diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ClassesTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ClassesTests.fs
index cb6e1ae7344..e86621d7093 100644
--- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ClassesTests.fs
+++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ClassesTests.fs
@@ -861,4 +861,83 @@ type C5 = class inherit System.MulticastDelegate override x.ToString() = "" end
(Error 771, Line 4, Col 25, Line 4, Col 36, "The types System.ValueType, System.Enum, System.Delegate, System.MulticastDelegate and System.Array cannot be used as super types in an object expression or class")
(Error 771, Line 5, Col 25, Line 5, Col 40, "The types System.ValueType, System.Enum, System.Delegate, System.MulticastDelegate and System.Array cannot be used as super types in an object expression or class");
(Error 771, Line 6, Col 25, Line 6, Col 49, "The types System.ValueType, System.Enum, System.Delegate, System.MulticastDelegate and System.Array cannot be used as super types in an object expression or class")
+ ]
+
+
+ []
+ let ``Types can inherit from a single concrete type`` () =
+ Fsx """
+type ClassA() = class end
+
+type Class() =
+ inherit ClassA()
+ """
+ |> typecheck
+ |> shouldSucceed
+
+ []
+ let ``Types cannot inherit from multiple concrete types.`` () =
+ Fsx """
+type ClassA() = class end
+
+type ClassB() = class end
+
+type ClassC() = class end
+
+type Class() =
+ inherit ClassA()
+ inherit ClassB()
+ inherit ClassC()
+ """
+ |> typecheck
+ |> shouldFail
+ |> withDiagnostics [
+ (Error 959, Line 8, Col 6, Line 8, Col 11, "Type definitions may only have one 'inherit' specification and it must be the first declaration")
+ (Error 932, Line 10, Col 13, Line 10, Col 19, "Types cannot inherit from multiple concrete types")
+ (Error 932, Line 11, Col 13, Line 11, Col 19, "Types cannot inherit from multiple concrete types")
+ ]
+
+ []
+ let ``Types cannot inherit from multiple concrete types. Type name cannot be empty.`` () =
+ Fsx """
+type IA = interface end
+
+type I =
+ inherit IA
+ inherit
+ """
+ |> typecheck
+ |> shouldFail
+ |> withDiagnostics [
+ (Error 3159, Line 6, Col 5, Line 6, Col 12, "Type name cannot be empty.")
+ ]
+
+ []
+ let ``Inheriting multiple base interfaces`` () =
+ Fsx """
+type IA = interface end
+type IB = interface end
+
+type I =
+ inherit IA
+ inherit IB
+ """
+ |> typecheck
+ |> shouldSucceed
+
+ []
+ let ``Class inheriting multiple base interfaces`` () =
+ Fsx """
+type IA = interface end
+type IB = interface end
+
+type I() =
+ inherit IA
+ inherit IB
+ """
+ |> typecheck
+ |> shouldFail
+ |> withDiagnostics [
+ (Error 961, Line 6, Col 5, Line 6, Col 12, "This 'inherit' declaration specifies the inherited type but no arguments. Consider supplying arguments, e.g. 'inherit BaseType(args)'.")
+ (Error 932, Line 7, Col 13, Line 7, Col 15, "Types cannot inherit from multiple concrete types")
]
\ No newline at end of file
diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl
index e0ba696955a..5f4436a79f2 100644
--- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl
+++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl
@@ -8150,7 +8150,9 @@ FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewAb
FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewAutoProperty(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Boolean, FSharp.Compiler.Syntax.Ident, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType], FSharp.Compiler.Syntax.SynMemberKind, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Xml.PreXmlDoc, FSharp.Compiler.Syntax.SynValSigAccess, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia)
FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewGetSetMember(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynBinding], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynBinding], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia)
FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewImplicitCtor(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], FSharp.Compiler.Syntax.SynPat, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Xml.PreXmlDoc, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberDefnImplicitCtorTrivia)
-FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewImplicitInherit(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynExpr, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Text.Range)
+FSharp.Compiler.Syntax.SynMemberDefn+ImplicitInherit: FSharp.Compiler.SyntaxTrivia.SynMemberDefnInheritTrivia get_trivia()
+FSharp.Compiler.Syntax.SynMemberDefn+ImplicitInherit: FSharp.Compiler.SyntaxTrivia.SynMemberDefnInheritTrivia trivia
+FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewImplicitInherit(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynExpr, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberDefnInheritTrivia)
FSharp.Compiler.Syntax.SynMemberDefn+Inherit: FSharp.Compiler.SyntaxTrivia.SynMemberDefnInheritTrivia get_trivia()
FSharp.Compiler.Syntax.SynMemberDefn+Inherit: FSharp.Compiler.SyntaxTrivia.SynMemberDefnInheritTrivia trivia
FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewInherit(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberDefnInheritTrivia)
diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl
index e0ba696955a..5f4436a79f2 100644
--- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl
+++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl
@@ -8150,7 +8150,9 @@ FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewAb
FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewAutoProperty(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Boolean, FSharp.Compiler.Syntax.Ident, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType], FSharp.Compiler.Syntax.SynMemberKind, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Syntax.SynMemberFlags, FSharp.Compiler.Xml.PreXmlDoc, FSharp.Compiler.Syntax.SynValSigAccess, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberDefnAutoPropertyTrivia)
FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewGetSetMember(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynBinding], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynBinding], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia)
FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewImplicitCtor(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], FSharp.Compiler.Syntax.SynPat, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Xml.PreXmlDoc, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberDefnImplicitCtorTrivia)
-FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewImplicitInherit(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynExpr, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Text.Range)
+FSharp.Compiler.Syntax.SynMemberDefn+ImplicitInherit: FSharp.Compiler.SyntaxTrivia.SynMemberDefnInheritTrivia get_trivia()
+FSharp.Compiler.Syntax.SynMemberDefn+ImplicitInherit: FSharp.Compiler.SyntaxTrivia.SynMemberDefnInheritTrivia trivia
+FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewImplicitInherit(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynExpr, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberDefnInheritTrivia)
FSharp.Compiler.Syntax.SynMemberDefn+Inherit: FSharp.Compiler.SyntaxTrivia.SynMemberDefnInheritTrivia get_trivia()
FSharp.Compiler.Syntax.SynMemberDefn+Inherit: FSharp.Compiler.SyntaxTrivia.SynMemberDefnInheritTrivia trivia
FSharp.Compiler.Syntax.SynMemberDefn: FSharp.Compiler.Syntax.SynMemberDefn NewInherit(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynMemberDefnInheritTrivia)
diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Cancellation.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Cancellation.fs
index cecfaec7590..a2a97e4d58c 100644
--- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Cancellation.fs
+++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Cancellation.fs
@@ -265,11 +265,11 @@ type CancellationType() =
let cts = new CancellationTokenSource()
let tcs = System.Threading.Tasks.TaskCompletionSource<_>()
- let test() =
+ let t =
async {
do! tcs.Task |> Async.AwaitTask
}
- |> StartAsTaskProperCancel None (Some cts.Token) :> Task
+ |> StartAsTaskProperCancel None (Some cts.Token)
// First cancel the token, then set the task as cancelled.
async {
@@ -277,14 +277,15 @@ type CancellationType() =
cts.Cancel()
do! Async.Sleep 100
tcs.TrySetException (TimeoutException "Task timed out after token.")
- |> ignore
+ |> ignore
} |> Async.Start
- task {
- let! agg = Assert.ThrowsAsync(test)
- let inner = agg.InnerException
- Assert.True(inner :? TimeoutException, $"Excepted TimeoutException wrapped in an AggregateException, but got %A{inner}")
- }
+ try
+ let res = t.Wait(2000)
+ let msg = sprintf "Excepted TimeoutException wrapped in an AggregateException, but got %A" res
+ printfn "failure msg: %s" msg
+ Assert.Fail (msg)
+ with :? AggregateException as agg -> ()
// Simpler regression test for https://github.com/dotnet/fsharp/issues/3254
[]
diff --git a/tests/service/data/SyntaxTree/Member/Inherit 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 02.fs.bsl
index 51185750c32..3a9482667e2 100644
--- a/tests/service/data/SyntaxTree/Member/Inherit 02.fs.bsl
+++ b/tests/service/data/SyntaxTree/Member/Inherit 02.fs.bsl
@@ -13,11 +13,11 @@ ImplFile
(Unspecified,
[ImplicitInherit
(LongIdent (SynLongIdent ([T2], [], [None])),
- Const (Unit, (4,14--4,16)), None, (4,4--4,16))],
- (4,4--4,16)), [], None, (3,5--4,16),
- { LeadingKeyword = Type (3,0--3,4)
- EqualsRange = Some (3,8--3,9)
- WithKeyword = None })], (3,0--4,16))],
+ Const (Unit, (4,14--4,16)), None, (4,4--4,16),
+ { InheritKeyword = (4,4--4,11) })], (4,4--4,16)), [],
+ None, (3,5--4,16), { LeadingKeyword = Type (3,0--3,4)
+ EqualsRange = Some (3,8--3,9)
+ WithKeyword = None })], (3,0--4,16))],
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None,
(1,0--4,16), { LeadingKeyword = Module (1,0--1,6) })], (true, true),
{ ConditionalDirectives = []