@@ -17,7 +17,7 @@ open FSharp.Compiler.TypedTree
1717open FSharp.Compiler .TypedTreeOps
1818
1919#if ! NO_ TYPEPROVIDERS
20- open FSharp.Compiler .ExtensionTyping
20+ open FSharp.Compiler .TypeProviders
2121open FSharp.Core .CompilerServices
2222#endif
2323
@@ -26,46 +26,46 @@ exception ObsoleteError of string * range
2626
2727let fail () = failwith " This custom attribute has an argument that can not yet be converted using this API"
2828
29- let rec private evalILAttribElem e =
30- match e with
31- | ILAttribElem.String ( Some x) -> box x
32- | ILAttribElem.String None -> null
33- | ILAttribElem.Bool x -> box x
34- | ILAttribElem.Char x -> box x
35- | ILAttribElem.SByte x -> box x
36- | ILAttribElem.Int16 x -> box x
37- | ILAttribElem.Int32 x -> box x
38- | ILAttribElem.Int64 x -> box x
39- | ILAttribElem.Byte x -> box x
40- | ILAttribElem.UInt16 x -> box x
41- | ILAttribElem.UInt32 x -> box x
42- | ILAttribElem.UInt64 x -> box x
43- | ILAttribElem.Single x -> box x
44- | ILAttribElem.Double x -> box x
45- | ILAttribElem.Null -> null
46- | ILAttribElem.Array (_, a) -> box [| for i in a -> evalILAttribElem i |]
29+ let rec private evalILAttribElem elem =
30+ match elem with
31+ | ILAttribElem.String ( Some x) -> box x
32+ | ILAttribElem.String None -> null
33+ | ILAttribElem.Bool x -> box x
34+ | ILAttribElem.Char x -> box x
35+ | ILAttribElem.SByte x -> box x
36+ | ILAttribElem.Int16 x -> box x
37+ | ILAttribElem.Int32 x -> box x
38+ | ILAttribElem.Int64 x -> box x
39+ | ILAttribElem.Byte x -> box x
40+ | ILAttribElem.UInt16 x -> box x
41+ | ILAttribElem.UInt32 x -> box x
42+ | ILAttribElem.UInt64 x -> box x
43+ | ILAttribElem.Single x -> box x
44+ | ILAttribElem.Double x -> box x
45+ | ILAttribElem.Null -> null
46+ | ILAttribElem.Array (_, a) -> box [| for i in a -> evalILAttribElem i |]
4747 // TODO: typeof<..> in attribute values
48- | ILAttribElem.Type ( Some _ t) -> fail()
49- | ILAttribElem.Type None -> null
48+ | ILAttribElem.Type ( Some _ t) -> fail()
49+ | ILAttribElem.Type None -> null
5050 | ILAttribElem.TypeRef ( Some _ t) -> fail()
51- | ILAttribElem.TypeRef None -> null
51+ | ILAttribElem.TypeRef None -> null
5252
53- let rec private evalFSharpAttribArg g e =
54- match stripDebugPoints e with
53+ let rec private evalFSharpAttribArg g attribExpr =
54+ match stripDebugPoints attribExpr with
5555 | Expr.Const ( c, _, _) ->
5656 match c with
5757 | Const.Bool b -> box b
58- | Const.SByte i -> box i
59- | Const.Int16 i -> box i
60- | Const.Int32 i -> box i
61- | Const.Int64 i -> box i
62- | Const.Byte i -> box i
63- | Const.UInt16 i -> box i
64- | Const.UInt32 i -> box i
65- | Const.UInt64 i -> box i
66- | Const.Single i -> box i
58+ | Const.SByte i -> box i
59+ | Const.Int16 i -> box i
60+ | Const.Int32 i -> box i
61+ | Const.Int64 i -> box i
62+ | Const.Byte i -> box i
63+ | Const.UInt16 i -> box i
64+ | Const.UInt32 i -> box i
65+ | Const.UInt64 i -> box i
66+ | Const.Single i -> box i
6767 | Const.Double i -> box i
68- | Const.Char i -> box i
68+ | Const.Char i -> box i
6969 | Const.Zero -> null
7070 | Const.String s -> box s
7171 | _ -> fail()
@@ -233,7 +233,7 @@ let private CheckILAttributes (g: TcGlobals) isByrefLikeTyconRef cattrs m =
233233 match TryDecodeILAttribute tref cattrs with
234234 | Some ([ ILAttribElem.String ( Some msg) ], _) when not isByrefLikeTyconRef ->
235235 WarnD( ObsoleteWarning( msg, m))
236- | Some ([ ILAttribElem.String ( Some msg); ILAttribElem.Bool isError ], _) when not isByrefLikeTyconRef ->
236+ | Some ([ ILAttribElem.String ( Some msg); ILAttribElem.Bool isError ], _) when not isByrefLikeTyconRef ->
237237 if isError then
238238 ErrorD ( ObsoleteError( msg, m))
239239 else
@@ -313,7 +313,7 @@ let private CheckProvidedAttributes (g: TcGlobals) m (provAttribs: Tainted<IProv
313313 let ( AttribInfo ( tref , _ )) = g.attrib_ SystemObsolete
314314 match provAttribs.PUntaint(( fun a -> a.GetAttributeConstructorArgs( provAttribs.TypeProvider.PUntaintNoFailure( id), tref.FullName)), m) with
315315 | Some ([ Some (:? string as msg) ], _) -> WarnD( ObsoleteWarning( msg, m))
316- | Some ([ Some (:? string as msg); Some (:? bool as isError) ], _) ->
316+ | Some ([ Some (:? string as msg); Some (:? bool as isError) ], _) ->
317317 if isError then
318318 ErrorD ( ObsoleteError( msg, m))
319319 else
0 commit comments