未验证 提交 0825e8cf 编写于 作者: A Alfonso Garcia-Caro 提交者: GitHub

Add FSharpType.IsMeasureType (#14978)

* Add FSharpType.IsMeasureType

* Surface area updated

---------
Co-authored-by: NTomas Grosup <tomasgrosup@microsoft.com>
上级 2ce1825f
......@@ -2423,6 +2423,13 @@ type FSharpType(cenv, ty:TType) =
| TType_app _ | TType_measure (Measure.Const _ | Measure.Prod _ | Measure.Inv _ | Measure.One) -> true
| _ -> false
member _.IsMeasureType =
isResolved() &&
protect <| fun () ->
match stripTyparEqns ty with
| TType_measure _ -> true
| _ -> false
member _.IsTupleType =
isResolved() &&
protect <| fun () ->
......
......@@ -1073,6 +1073,9 @@ type FSharpType =
/// Get the generic arguments for a tuple type, a function type or a type constructed using a named entity
member GenericArguments: IList<FSharpType>
/// Indicates if the type is a measure type.
member IsMeasureType: bool
/// Indicates if the type is a tuple type (reference or struct). The GenericArguments property returns the elements of the tuple type.
member IsTupleType: bool
......
......@@ -5066,6 +5066,7 @@ FSharp.Compiler.Symbols.FSharpType: Boolean IsAbbreviation
FSharp.Compiler.Symbols.FSharpType: Boolean IsAnonRecordType
FSharp.Compiler.Symbols.FSharpType: Boolean IsFunctionType
FSharp.Compiler.Symbols.FSharpType: Boolean IsGenericParameter
FSharp.Compiler.Symbols.FSharpType: Boolean IsMeasureType
FSharp.Compiler.Symbols.FSharpType: Boolean IsStructTupleType
FSharp.Compiler.Symbols.FSharpType: Boolean IsTupleType
FSharp.Compiler.Symbols.FSharpType: Boolean IsUnresolved
......@@ -5074,6 +5075,7 @@ FSharp.Compiler.Symbols.FSharpType: Boolean get_IsAbbreviation()
FSharp.Compiler.Symbols.FSharpType: Boolean get_IsAnonRecordType()
FSharp.Compiler.Symbols.FSharpType: Boolean get_IsFunctionType()
FSharp.Compiler.Symbols.FSharpType: Boolean get_IsGenericParameter()
FSharp.Compiler.Symbols.FSharpType: Boolean get_IsMeasureType()
FSharp.Compiler.Symbols.FSharpType: Boolean get_IsStructTupleType()
FSharp.Compiler.Symbols.FSharpType: Boolean get_IsTupleType()
FSharp.Compiler.Symbols.FSharpType: Boolean get_IsUnresolved()
......@@ -5066,6 +5066,7 @@ FSharp.Compiler.Symbols.FSharpType: Boolean IsAbbreviation
FSharp.Compiler.Symbols.FSharpType: Boolean IsAnonRecordType
FSharp.Compiler.Symbols.FSharpType: Boolean IsFunctionType
FSharp.Compiler.Symbols.FSharpType: Boolean IsGenericParameter
FSharp.Compiler.Symbols.FSharpType: Boolean IsMeasureType
FSharp.Compiler.Symbols.FSharpType: Boolean IsStructTupleType
FSharp.Compiler.Symbols.FSharpType: Boolean IsTupleType
FSharp.Compiler.Symbols.FSharpType: Boolean IsUnresolved
......@@ -5074,6 +5075,7 @@ FSharp.Compiler.Symbols.FSharpType: Boolean get_IsAbbreviation()
FSharp.Compiler.Symbols.FSharpType: Boolean get_IsAnonRecordType()
FSharp.Compiler.Symbols.FSharpType: Boolean get_IsFunctionType()
FSharp.Compiler.Symbols.FSharpType: Boolean get_IsGenericParameter()
FSharp.Compiler.Symbols.FSharpType: Boolean get_IsMeasureType()
FSharp.Compiler.Symbols.FSharpType: Boolean get_IsStructTupleType()
FSharp.Compiler.Symbols.FSharpType: Boolean get_IsTupleType()
FSharp.Compiler.Symbols.FSharpType: Boolean get_IsUnresolved()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册