@@ -3622,7 +3622,11 @@ module EstablishTypeDefinitionCores =
36223622 // Note: for a mutually recursive set we can't check this condition
36233623 // until "isSealedTy" and "isClassTy" give reliable results.
36243624 superTy |> Option.iter ( fun ty ->
3625- let m = match inherits with | [] -> m | (_, m, _) :: _ -> m
3625+ let m =
3626+ match inherits with
3627+ | [] -> m
3628+ | ( synType, _, _) :: _ -> synType.Range
3629+
36263630 if isSealedTy g ty then
36273631 errorR( Error( FSComp.SR.tcCannotInheritFromSealedType(), m))
36283632 elif not ( isClassTy g ty) then
@@ -4292,7 +4296,7 @@ module TcDeclarations =
42924296 | SynMemberDefn.AutoProperty ( range= m) :: _ -> errorR( InternalError( " List.takeUntil is wrong, have auto property" , m))
42934297 | SynMemberDefn.ImplicitInherit ( range= m) :: _ -> errorR( Error( FSComp.SR.tcTypeDefinitionsWithImplicitConstructionMustHaveOneInherit(), m))
42944298 | SynMemberDefn.LetBindings ( range= m) :: _ -> errorR( Error( FSComp.SR.tcTypeDefinitionsWithImplicitConstructionMustHaveLocalBindingsBeforeMembers(), m))
4295- | SynMemberDefn.Inherit ( range = m ) :: _ -> errorR( Error( FSComp.SR.tcInheritDeclarationMissingArguments(), m))
4299+ | SynMemberDefn.Inherit ( trivia = { InheritKeyword = m } ) :: _ -> errorR( Error( FSComp.SR.tcInheritDeclarationMissingArguments(), m))
42964300 | SynMemberDefn.NestedType ( range= m) :: _ -> errorR( Error( FSComp.SR.tcTypesCannotContainNestedTypes(), m))
42974301 | _ -> ()
42984302 | ds ->
@@ -4464,7 +4468,7 @@ module TcDeclarations =
44644468 let implements2 = members |> List.choose ( function SynMemberDefn.Interface ( interfaceType= ty) -> Some( ty, ty.Range) | _ -> None)
44654469 let inherits =
44664470 members |> List.choose ( function
4467- | SynMemberDefn.Inherit ( ty, idOpt, m) -> Some( ty, m, idOpt)
4471+ | SynMemberDefn.Inherit ( ty, idOpt, m, _ ) -> Some( ty, m, idOpt)
44684472 | SynMemberDefn.ImplicitInherit ( ty, _, idOpt, m) -> Some( ty, m, idOpt)
44694473 | _ -> None)
44704474
0 commit comments