@@ -4657,7 +4657,7 @@ and TcTypeOrMeasure optKind cenv newOk checkCxs occ env (tpenv: SyntacticUnscope
46574657 | _, TyparKind.Type ->
46584658 TcTypeApp cenv newOk checkCxs occ env tpenv m tcref [] []
46594659
4660- | SynType.App (SynType.LongIdent(LongIdentWithDots(tc, _)), _, args, _commas, _, postfix, m) ->
4660+ | SynType.App (StripParenTypes ( SynType.LongIdent(LongIdentWithDots(tc, _) )), _, args, _commas, _, postfix, m) ->
46614661 let ad = env.eAccessRights
46624662
46634663 let tcref =
@@ -4793,7 +4793,7 @@ and TcTypeOrMeasure optKind cenv newOk checkCxs occ env (tpenv: SyntacticUnscope
47934793 let ms2, tpenv = TcMeasure cenv newOk checkCxs occ env tpenv typ2 m
47944794 TType_measure (Measure.Prod(ms1, Measure.Inv ms2)), tpenv
47954795
4796- | SynType.App((SynType.Var(_, m1) | SynType.MeasurePower(_, _, m1)) as arg1, _, args, _commas, _, postfix, m) ->
4796+ | SynType.App(StripParenTypes (SynType.Var(_, m1) | ( SynType.MeasurePower(_, _, m1) )) as arg1, _, args, _commas, _, postfix, m) ->
47974797 match optKind, args, postfix with
47984798 | (None | Some TyparKind.Measure), [arg2], true ->
47994799 let ms1, tpenv = TcMeasure cenv newOk checkCxs occ env tpenv arg1 m1
@@ -4808,10 +4808,13 @@ and TcTypeOrMeasure optKind cenv newOk checkCxs occ env (tpenv: SyntacticUnscope
48084808 errorR(Error(FSComp.SR.tcIllegalSyntaxInTypeExpression(), m))
48094809 NewErrorType (), tpenv
48104810
4811+ | SynType.Paren(innerType, _) ->
4812+ TcTypeOrMeasure optKind cenv newOk checkCxs occ env (tpenv: SyntacticUnscopedTyparEnv) innerType
4813+
48114814and TcType cenv newOk checkCxs occ env (tpenv: SyntacticUnscopedTyparEnv) ty =
48124815 TcTypeOrMeasure (Some TyparKind.Type) cenv newOk checkCxs occ env tpenv ty
48134816
4814- and TcMeasure cenv newOk checkCxs occ env (tpenv: SyntacticUnscopedTyparEnv) ty m =
4817+ and TcMeasure cenv newOk checkCxs occ env (tpenv: SyntacticUnscopedTyparEnv) (StripParenTypes ty) m =
48154818 match ty with
48164819 | SynType.Anon m ->
48174820 error(Error(FSComp.SR.tcAnonymousUnitsOfMeasureCannotBeNested(), m))
@@ -4869,7 +4872,7 @@ and TcTyparConstraints cenv newOk checkCxs occ env tpenv wcs =
48694872 tpenv
48704873
48714874#if !NO_EXTENSIONTYPING
4872- and TcStaticConstantParameter cenv (env: TcEnv) tpenv kind (v: SynType ) idOpt container =
4875+ and TcStaticConstantParameter cenv (env: TcEnv) tpenv kind (StripParenTypes v ) idOpt container =
48734876 let g = cenv.g
48744877 let fail() = error(Error(FSComp.SR.etInvalidStaticArgument(NicePrint.minimalStringOfType env.DisplayEnv kind), v.Range))
48754878 let record ttype =
@@ -4938,7 +4941,7 @@ and TcStaticConstantParameter cenv (env: TcEnv) tpenv kind (v: SynType) idOpt co
49384941and CrackStaticConstantArgs cenv env tpenv (staticParameters: Tainted<ProvidedParameterInfo>[], args: SynType list, container, containerName, m) =
49394942 let args =
49404943 args |> List.map (function
4941- | SynType.StaticConstantNamed(SynType.LongIdent(LongIdentWithDots([id], _)), v, _) -> Some id, v
4944+ | StripParenTypes ( SynType.StaticConstantNamed(StripParenTypes ( SynType.LongIdent(LongIdentWithDots([id], _))) , v, _) ) -> Some id, v
49424945 | v -> None, v)
49434946
49444947 let unnamedArgs = args |> Seq.takeWhile (fst >> Option.isNone) |> Seq.toArray |> Array.map snd
@@ -15343,9 +15346,9 @@ module EstablishTypeDefinitionCores =
1534315346 k
1534415347
1534515348
15346- let private (|TyconCoreAbbrevThatIsReallyAUnion|_|) (hasMeasureAttr, envinner, id: Ident) synTyconRepr =
15349+ let private (|TyconCoreAbbrevThatIsReallyAUnion|_|) (hasMeasureAttr, envinner, id: Ident) ( synTyconRepr) =
1534715350 match synTyconRepr with
15348- | SynTypeDefnSimpleRepr.TypeAbbrev(_, SynType.LongIdent(LongIdentWithDots([unionCaseName], _)), m)
15351+ | SynTypeDefnSimpleRepr.TypeAbbrev(_, StripParenTypes ( SynType.LongIdent(LongIdentWithDots([unionCaseName], _) )), m)
1534915352 when
1535015353 (not hasMeasureAttr &&
1535115354 (isNil (LookupTypeNameInEnvNoArity OpenQualified unionCaseName.idText envinner.eNameResEnv) ||
@@ -15628,11 +15631,11 @@ module EstablishTypeDefinitionCores =
1562815631
1562915632#if !NO_EXTENSIONTYPING
1563015633 /// Get the items on the r.h.s. of a 'type X = ABC<...>' definition
15631- let private TcTyconDefnCore_GetGenerateDeclaration_Rhs rhsType =
15634+ let private TcTyconDefnCore_GetGenerateDeclaration_Rhs (StripParenTypes rhsType) =
1563215635 match rhsType with
15633- | SynType.App (SynType.LongIdent(LongIdentWithDots(tc, _)), _, args, _commas, _, _postfix, m) -> Some(tc, args, m)
15636+ | SynType.App (StripParenTypes ( SynType.LongIdent(LongIdentWithDots(tc, _) )), _, args, _commas, _, _postfix, m) -> Some(tc, args, m)
1563415637 | SynType.LongIdent (LongIdentWithDots(tc, _) as lidwd) -> Some(tc, [], lidwd.Range)
15635- | SynType.LongIdentApp (SynType.LongIdent (LongIdentWithDots(tc, _)), LongIdentWithDots(longId, _), _, args, _commas, _, m) -> Some(tc@longId, args, m)
15638+ | SynType.LongIdentApp (StripParenTypes ( SynType.LongIdent (LongIdentWithDots(tc, _) )), LongIdentWithDots(longId, _), _, args, _commas, _, m) -> Some(tc@longId, args, m)
1563615639 | _ -> None
1563715640
1563815641 /// Check whether 'type X = ABC<...>' is a generative provided type definition
@@ -17147,7 +17150,7 @@ module TcDeclarations =
1714717150 memberFlags.MemberKind=MemberKind.Constructor &&
1714817151 // REVIEW: This is a syntactic approximation
1714917152 (match valSpfn.SynType, valSpfn.SynInfo.ArgInfos with
17150- | SynType.Fun (SynType.LongIdent (LongIdentWithDots([id], _)), _, _), [[_]] when id.idText = "unit" -> true
17153+ | StripParenTypes ( SynType.Fun (StripParenTypes ( SynType.LongIdent (LongIdentWithDots([id], _))) , _, _) ), [[_]] when id.idText = "unit" -> true
1715117154 | _ -> false)
1715217155 | _ -> false)
1715317156
0 commit comments