From 3351f761b0d5822b13ab312fa39c14765c60a3f7 Mon Sep 17 00:00:00 2001 From: nojaf Date: Wed, 19 Oct 2022 17:55:57 +0200 Subject: [PATCH] Remove SynType.MeasureDivide --- src/Compiler/Checking/CheckExpressions.fs | 3 --- src/Compiler/Service/ServiceInterfaceStubGenerator.fs | 1 - src/Compiler/Service/ServiceParseTreeWalk.fs | 1 - src/Compiler/Service/ServiceParsedInputOps.fs | 2 -- src/Compiler/SyntaxTree/SyntaxTree.fs | 3 --- src/Compiler/SyntaxTree/SyntaxTree.fsi | 3 --- ...p.CompilerService.SurfaceArea.netstandard.expected | 11 ----------- 7 files changed, 24 deletions(-) diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 2174ee705a6..9002e05c71f 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -4353,9 +4353,6 @@ and TcTypeOrMeasure kindOpt (cenv: cenv) newOk checkConstraints occ (iwsam: Warn | SynType.MeasurePower(ty, exponent, m) -> TcTypeMeasurePower kindOpt cenv newOk checkConstraints occ env tpenv ty exponent m - | SynType.MeasureDivide(typ1, typ2, m) -> - TcTypeMeasureDivide kindOpt cenv newOk checkConstraints occ env tpenv typ1 typ2 m - | SynType.App(arg1, _, args, _, _, postfix, m) -> TcTypeMeasureApp kindOpt cenv newOk checkConstraints occ env tpenv arg1 args postfix m diff --git a/src/Compiler/Service/ServiceInterfaceStubGenerator.fs b/src/Compiler/Service/ServiceInterfaceStubGenerator.fs index a5a3f8d844a..5042d2b1408 100644 --- a/src/Compiler/Service/ServiceInterfaceStubGenerator.fs +++ b/src/Compiler/Service/ServiceInterfaceStubGenerator.fs @@ -144,7 +144,6 @@ type InterfaceData = | SynType.AnonRecd (_, ts, _) -> Some(ts |> Seq.choose (snd >> (|TypeIdent|_|)) |> String.concat "; ") | SynType.Array (dimension, TypeIdent typeName, _) -> Some(sprintf "%s [%s]" typeName (String(',', dimension - 1))) | SynType.MeasurePower (TypeIdent typeName, RationalConst power, _) -> Some(sprintf "%s^%s" typeName power) - | SynType.MeasureDivide (TypeIdent numerator, TypeIdent denominator, _) -> Some(sprintf "%s/%s" numerator denominator) | SynType.Paren (TypeIdent typeName, _) -> Some typeName | _ -> None diff --git a/src/Compiler/Service/ServiceParseTreeWalk.fs b/src/Compiler/Service/ServiceParseTreeWalk.fs index 25e7544fb03..228fa5302a5 100755 --- a/src/Compiler/Service/ServiceParseTreeWalk.fs +++ b/src/Compiler/Service/ServiceParseTreeWalk.fs @@ -821,7 +821,6 @@ module SyntaxTraversal = | SynType.WithGlobalConstraints (ty, _, _) | SynType.Array (_, ty, _) -> traverseSynType path ty | SynType.StaticConstantNamed (ty1, ty2, _) - | SynType.MeasureDivide (ty1, ty2, _) | SynType.Or (ty1, ty2, _, _) -> [ ty1; ty2 ] |> List.tryPick (traverseSynType path) | SynType.Tuple (path = segments) -> getTypeFromTuplePath segments |> List.tryPick (traverseSynType path) | SynType.StaticConstantExpr (expr, _) -> traverseSynExpr [] expr diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index b98bd2248c9..0ab14efa942 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -668,7 +668,6 @@ module ParsedInput = | SynType.Fun (argType = t1; returnType = t2) -> walkType t1 |> Option.orElseWith (fun () -> walkType t2) | SynType.WithGlobalConstraints (t, _, _) -> walkType t | SynType.HashConstraint (t, _) -> walkType t - | SynType.MeasureDivide (t1, t2, _) | SynType.Or (t1, t2, _, _) -> walkType t1 |> Option.orElseWith (fun () -> walkType t2) | SynType.MeasurePower (t, _, _) -> walkType t | SynType.Paren (t, _) @@ -1676,7 +1675,6 @@ module ParsedInput = | SynType.Paren (t, _) | SynType.SignatureParameter (usedType = t) -> walkType t | SynType.Fun (argType = t1; returnType = t2) - | SynType.MeasureDivide (t1, t2, _) | SynType.Or (t1, t2, _, _) -> walkType t1 walkType t2 diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 540adc029e1..66951e620a8 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -427,8 +427,6 @@ type SynType = | HashConstraint of innerType: SynType * range: range - | MeasureDivide of dividend: SynType * divisor: SynType * range: range - | MeasurePower of baseMeasure: SynType * exponent: SynRationalConst * range: range | StaticConstant of constant: SynConst * range: range @@ -458,7 +456,6 @@ type SynType = | SynType.StaticConstantExpr (range = m) | SynType.StaticConstantNamed (range = m) | SynType.HashConstraint (range = m) - | SynType.MeasureDivide (range = m) | SynType.MeasurePower (range = m) | SynType.Paren (range = m) | SynType.SignatureParameter (range = m) diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 3e05507b340..9d12ce00e81 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -492,9 +492,6 @@ type SynType = /// F# syntax: #type | HashConstraint of innerType: SynType * range: range - /// F# syntax: for units of measure e.g. m / s - | MeasureDivide of dividend: SynType * divisor: SynType * range: range - /// F# syntax: for units of measure e.g. m^3, kg^1/2 | MeasurePower of baseMeasure: SynType * exponent: SynRationalConst * range: range diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected index 439ac088f60..e1814272d1b 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected @@ -8498,12 +8498,6 @@ FSharp.Compiler.Syntax.SynType+LongIdentApp: Microsoft.FSharp.Core.FSharpOption` FSharp.Compiler.Syntax.SynType+LongIdentApp: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_lessRange() FSharp.Compiler.Syntax.SynType+LongIdentApp: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] greaterRange FSharp.Compiler.Syntax.SynType+LongIdentApp: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] lessRange -FSharp.Compiler.Syntax.SynType+MeasureDivide: FSharp.Compiler.Syntax.SynType dividend -FSharp.Compiler.Syntax.SynType+MeasureDivide: FSharp.Compiler.Syntax.SynType divisor -FSharp.Compiler.Syntax.SynType+MeasureDivide: FSharp.Compiler.Syntax.SynType get_dividend() -FSharp.Compiler.Syntax.SynType+MeasureDivide: FSharp.Compiler.Syntax.SynType get_divisor() -FSharp.Compiler.Syntax.SynType+MeasureDivide: FSharp.Compiler.Text.Range get_range() -FSharp.Compiler.Syntax.SynType+MeasureDivide: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynType+MeasurePower: FSharp.Compiler.Syntax.SynRationalConst exponent FSharp.Compiler.Syntax.SynType+MeasurePower: FSharp.Compiler.Syntax.SynRationalConst get_exponent() FSharp.Compiler.Syntax.SynType+MeasurePower: FSharp.Compiler.Syntax.SynType baseMeasure @@ -8554,7 +8548,6 @@ FSharp.Compiler.Syntax.SynType+Tags: Int32 Fun FSharp.Compiler.Syntax.SynType+Tags: Int32 HashConstraint FSharp.Compiler.Syntax.SynType+Tags: Int32 LongIdent FSharp.Compiler.Syntax.SynType+Tags: Int32 LongIdentApp -FSharp.Compiler.Syntax.SynType+Tags: Int32 MeasureDivide FSharp.Compiler.Syntax.SynType+Tags: Int32 MeasurePower FSharp.Compiler.Syntax.SynType+Tags: Int32 Or FSharp.Compiler.Syntax.SynType+Tags: Int32 Paren @@ -8589,7 +8582,6 @@ FSharp.Compiler.Syntax.SynType: Boolean IsFun FSharp.Compiler.Syntax.SynType: Boolean IsHashConstraint FSharp.Compiler.Syntax.SynType: Boolean IsLongIdent FSharp.Compiler.Syntax.SynType: Boolean IsLongIdentApp -FSharp.Compiler.Syntax.SynType: Boolean IsMeasureDivide FSharp.Compiler.Syntax.SynType: Boolean IsMeasurePower FSharp.Compiler.Syntax.SynType: Boolean IsOr FSharp.Compiler.Syntax.SynType: Boolean IsParen @@ -8608,7 +8600,6 @@ FSharp.Compiler.Syntax.SynType: Boolean get_IsFun() FSharp.Compiler.Syntax.SynType: Boolean get_IsHashConstraint() FSharp.Compiler.Syntax.SynType: Boolean get_IsLongIdent() FSharp.Compiler.Syntax.SynType: Boolean get_IsLongIdentApp() -FSharp.Compiler.Syntax.SynType: Boolean get_IsMeasureDivide() FSharp.Compiler.Syntax.SynType: Boolean get_IsMeasurePower() FSharp.Compiler.Syntax.SynType: Boolean get_IsOr() FSharp.Compiler.Syntax.SynType: Boolean get_IsParen() @@ -8627,7 +8618,6 @@ FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewFun(FSharp.Com FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewHashConstraint(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewLongIdent(FSharp.Compiler.Syntax.SynLongIdent) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewLongIdentApp(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynLongIdent, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynType], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewMeasureDivide(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewMeasurePower(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynRationalConst, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewOr(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynTypeOrTrivia) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewParen(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) @@ -8646,7 +8636,6 @@ FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+Fun FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+HashConstraint FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+LongIdent FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+LongIdentApp -FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+MeasureDivide FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+MeasurePower FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+Or FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+Paren