@@ -281,11 +281,12 @@ let rec private transformDecisionTargets (com: IFableCompiler) (ctx: Context) ac
281281
282282let private skipAttribute ( name : string ) =
283283 // TODO: skip all attributes where definiton not known???
284- name.StartsWith " Microsoft.FSharp.Core" ||
285- name.StartsWith " System.Reflection" ||
286- name.StartsWith " System.Runtime.CompilerServices" ||
287- name.StartsWith " System.ObsoleteAttribute" ||
288- name.StartsWith " System.Diagnostics"
284+ // name.StartsWith "Microsoft.FSharp.Core" ||
285+ // name.StartsWith "System.Reflection" ||
286+ // name.StartsWith "System.Runtime.CompilerServices" ||
287+ // name.StartsWith "System.ObsoleteAttribute" ||
288+ // name.StartsWith "System.Diagnostics"
289+ false
289290
290291let private transformAttribute ( com : IFableCompiler ) ( ctx : Context ) ( a : FSharpAttribute ) =
291292 match a.AttributeType.TryFullName with
@@ -310,11 +311,29 @@ let private transformAttribute (com: IFableCompiler) (ctx : Context) (a : FSharp
310311 a.ConstructorArguments |> Seq.toList |> List.map ( fun ( t , v ) ->
311312 match v with
312313 | :? string as str -> Fable.Value( Fable.StringConstant str, None)
314+ | :? int8 as v -> Fable.Value( Fable.NumberConstant( float v, NumberKind.Int8), None)
315+ | :? uint8 as v -> Fable.Value( Fable.NumberConstant( float v, NumberKind.UInt8), None)
316+ | :? int16 as v -> Fable.Value( Fable.NumberConstant( float v, NumberKind.Int16), None)
317+ | :? uint16 as v -> Fable.Value( Fable.NumberConstant( float v, NumberKind.UInt16), None)
318+ | :? int32 as v -> Fable.Value( Fable.NumberConstant( float v, NumberKind.Int32), None)
319+ | :? uint32 as v -> Fable.Value( Fable.NumberConstant( float v, NumberKind.UInt32), None)
320+ | :? float32 as v -> Fable.Value( Fable.NumberConstant( float v, NumberKind.Float32), None)
321+ | :? float as v -> Fable.Value( Fable.NumberConstant( v, NumberKind.Float64), None)
313322 | _ -> Fable.Value( Fable.StringConstant ( string v), None)
314323 )
324+
325+
315326 let typ = makeTypeFromDef com ctx.GenericArgs ( System.Collections.Generic.List() :> IList<_>) a.AttributeType
316- let x = makeCallFrom com ctx None typ false [] None args ctor
317- Some ( fullname, x)
327+ try
328+ let x = makeCallFrom com ctx None typ false [] None args ctor
329+ match x with
330+ | AST.Fable.Value( AST.Fable.Null AST.Fable.Any, None) ->
331+ com.RemoveLastError()
332+ None
333+ | _ ->
334+ Some ( fullname, x)
335+ with _ ->
336+ None
318337 | _ ->
319338 None
320339 | _ ->
@@ -1545,6 +1564,9 @@ type FableCompiler(com: ICompiler, implFiles: IDictionary<string, FSharpImplemen
15451564 member __.AddLog ( msg , severity , ? range , ? fileName : string , ? tag : string ) =
15461565 com.AddLog( msg, severity, ?range= range, ?fileName= fileName, ?tag= tag)
15471566
1567+ member __.RemoveLastError () =
1568+ com.RemoveLastError()
1569+
15481570let getRootModuleFullName ( file : FSharpImplementationFileContents ) =
15491571 let rootEnt , _ = getRootModuleAndDecls file.Declarations
15501572 match rootEnt with
0 commit comments