@@ -2541,7 +2541,7 @@ let rec evalILAttribElem e =
25412541 | ILAttribElem.TypeRef ( Some _ t) -> fail()
25422542 | ILAttribElem.TypeRef None -> null
25432543
2544- let evalFSharpAttribArg e =
2544+ let rec evalFSharpAttribArg g e =
25452545 match e with
25462546 | Expr.Const( c,_,_) ->
25472547 match c with
@@ -2560,8 +2560,9 @@ let evalFSharpAttribArg e =
25602560 | Const.Zero -> null
25612561 | Const.String s -> box s
25622562 | _ -> fail()
2563- // TODO: typeof<..> in attribute values
2564- // TODO: arrays in attribute values
2563+ | Expr.Op ( TOp.Array,_, a,_) -> box [| for i in a -> evalFSharpAttribArg g i |]
2564+ | TypeOfExpr g ty -> box ty
2565+ // TODO: | TypeDefOfExpr g ty
25652566 | _ -> fail()
25662567
25672568type AttribInfo =
@@ -2590,7 +2591,7 @@ type AttribInfo =
25902591 unnamedArgs
25912592 |> List.map ( fun ( AttribExpr ( origExpr , evaluatedExpr )) ->
25922593 let ty = tyOfExpr g origExpr
2593- let obj = evalFSharpAttribArg evaluatedExpr
2594+ let obj = evalFSharpAttribArg g evaluatedExpr
25942595 ty, obj)
25952596 | ILAttribInfo ( g, amap, scoref, cattr, m) ->
25962597 let parms , _args = decodeILAttribData g.ilg cattr ( Some scoref)
@@ -2605,7 +2606,7 @@ type AttribInfo =
26052606 namedArgs
26062607 |> List.map ( fun ( AttribNamedArg ( nm , _ , isField , AttribExpr ( origExpr , evaluatedExpr ))) ->
26072608 let ty = tyOfExpr g origExpr
2608- let obj = evalFSharpAttribArg evaluatedExpr
2609+ let obj = evalFSharpAttribArg g evaluatedExpr
26092610 ty, nm, isField, obj)
26102611 | ILAttribInfo ( g, amap, scoref, cattr, m) ->
26112612 let _parms , namedArgs = decodeILAttribData g.ilg cattr ( Some scoref)
0 commit comments