From 754284f023c2f90d26e5d54666a049c29f9a2cf1 Mon Sep 17 00:00:00 2001 From: KevinRansom Date: Thu, 7 Jul 2016 13:02:35 -0700 Subject: [PATCH 1/5] Teach fsharp that System.ValueTuple is a framework assembly --- src/fsharp/CompileOps.fs | 4 +++- src/fsharp/FSharp.Compiler/FSharp.Compiler.fsproj | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index f820d62d023..c43868db070 100755 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -1618,7 +1618,8 @@ let DefaultBasicReferencesForOutOfProjectSources = yield "System.Runtime.Serialization.Formatters.Soap" yield "System.Data" yield "System.Drawing" - + yield "System.ValueTuple" + // Don't reference System.Core for .NET 2.0 compilations. // // We only use a default reference to System.Core if one exists which we can load it into the compiler process. @@ -1660,6 +1661,7 @@ let SystemAssemblies primaryAssemblyName = yield "System.Runtime" yield "System.Observable" yield "System.Numerics" + yield "System.ValueTuple" // Additions for coreclr and portable profiles yield "System.Collections" diff --git a/src/fsharp/FSharp.Compiler/FSharp.Compiler.fsproj b/src/fsharp/FSharp.Compiler/FSharp.Compiler.fsproj index 9ec2850ae28..95325b997c3 100644 --- a/src/fsharp/FSharp.Compiler/FSharp.Compiler.fsproj +++ b/src/fsharp/FSharp.Compiler/FSharp.Compiler.fsproj @@ -527,7 +527,7 @@ ..\..\..\packages\Microsoft.DiaSymReader.1.0.8\lib\portable-net45+win8\Microsoft.DiaSymReader.dll ..\..\..\packages\System.Reflection.Metadata.1.4.1-beta-24227-04\lib\portable-net45+win8\System.Reflection.Metadata.dll ..\..\..\packages\System.Collections.Immutable.1.2.0\lib\portable-net45+win8+wp8+wpa81 - ..\..\..\packages\System.ValueTuple.4.0.0-rc3-24212-01\lib\netstandard1.1 + ..\..\..\packages\System.ValueTuple.4.0.0-rc3-24212-01\lib\netstandard1.1false @@ -538,7 +538,6 @@ - From 09a1135772b3dc2d2ba239924fd599f77a254e12 Mon Sep 17 00:00:00 2001 From: KevinRansom Date: Sat, 9 Jul 2016 00:36:34 -0700 Subject: [PATCH 2/5] Update reflect.fs to use fields for ValueTuples --- src/fsharp/FSharp.Core/reflect.fs | 96 ++++++++++++++++++++++--------- 1 file changed, 70 insertions(+), 26 deletions(-) diff --git a/src/fsharp/FSharp.Core/reflect.fs b/src/fsharp/FSharp.Core/reflect.fs index 509f352d647..6382f117abd 100644 --- a/src/fsharp/FSharp.Core/reflect.fs +++ b/src/fsharp/FSharp.Core/reflect.fs @@ -522,7 +522,7 @@ module internal Impl = let tysA = tyargs.[0..tupleEncField-1] let tyB = tyargs.[tupleEncField] Array.append tysA (getTupleTypeInfo tyB) - else + else tyargs let orderTupleProperties (props:PropertyInfo[]) = @@ -548,20 +548,54 @@ module internal Impl = haveNames = expectNames) #endif props - + + let orderTupleFields (fields:FieldInfo[]) = + // The tuple fields are of the form: + // Item1 + // .. + // Item1, Item2, ..., Item + // Item1, Item2, ..., Item, Rest + // The PropertyInfo may not come back in order, so ensure ordering here. +#if FX_ATLEAST_PORTABLE +#else + assert(maxTuple < 10) // Alphasort will only works for upto 9 items: Item1, Item10, Item2, Item3, ..., Item9, Rest +#endif + let fields = fields |> Array.sortBy (fun fi -> fi.Name) // they are not always in alphabetic order +#if FX_ATLEAST_PORTABLE +#else + assert(fields.Length <= maxTuple) + assert(let haveNames = fields |> Array.map (fun fi -> fi.Name) + let expectNames = Array.init fields.Length (fun i -> let j = i+1 // index j = 1,2,..,fields.Length <= maxTuple + if j orderTupleProperties + let ctor = + if typ.IsValueType then + let fields = typ.GetFields() |> orderTupleFields #if FX_ATLEAST_PORTABLE - let ctor = typ.GetConstructor(props |> Array.map (fun p -> p.PropertyType)) - ignore bindingFlags -#else - let ctor = typ.GetConstructor(BindingFlags.Instance ||| bindingFlags,null,props |> Array.map (fun p -> p.PropertyType),null) -#endif - match ctor with - | null -> raise <| ArgumentException(SR.GetString1(SR.invalidTupleTypeConstructorNotDefined, typ.FullName)) - | _ -> () - ctor - + ignore bindingFlags + typ.GetConstructor(fields |> Array.map (fun fi -> fi.FieldType)) +#else + typ.GetConstructor(BindingFlags.Instance ||| bindingFlags,null,fields |> Array.map (fun fi -> fi.FieldType),null) +#endif + else + let props = typ.GetProperties() |> orderTupleProperties +#if FX_ATLEAST_PORTABLE + ignore bindingFlags + typ.GetConstructor(props |> Array.map (fun p -> p.PropertyType)) +#else + typ.GetConstructor(BindingFlags.Instance ||| bindingFlags,null,props |> Array.map (fun p -> p.PropertyType),null) +#endif + match ctor with + | null -> raise <| ArgumentException(SR.GetString1(SR.invalidTupleTypeConstructorNotDefined, typ.FullName)) + | _ -> () + ctor + let getTupleCtor(typ:Type,bindingFlags) = let ctor = getTupleConstructorMethod(typ,bindingFlags) (fun (args:obj[]) -> @@ -569,13 +603,18 @@ module internal Impl = ctor.Invoke(args)) #else ctor.Invoke(BindingFlags.InvokeMethod ||| BindingFlags.Instance ||| bindingFlags,null,args,null)) -#endif +#endif let rec getTupleReader (typ:Type) = let etys = typ.GetGenericArguments() // Get the reader for the outer tuple record - let props = typ.GetProperties(instancePropertyFlags ||| BindingFlags.Public) |> orderTupleProperties - let reader = (fun (obj:obj) -> props |> Array.map (fun prop -> prop.GetValue(obj,null))) + let reader = + if typ.IsValueType then + let fields = (typ.GetFields(instancePropertyFlags ||| BindingFlags.Public) |> orderTupleFields) + ((fun (obj:obj) -> fields |> Array.map (fun field -> field.GetValue(obj)))) + else + let props = (typ.GetProperties(instancePropertyFlags ||| BindingFlags.Public) |> orderTupleProperties) + ((fun (obj:obj) -> props |> Array.map (fun prop -> prop.GetValue(obj,null)))) if etys.Length < maxTuple then reader else @@ -585,7 +624,7 @@ module internal Impl = let directVals = reader obj let encVals = reader2 directVals.[tupleEncField] Array.append directVals.[0..tupleEncField-1] encVals) - + let rec getTupleConstructor (typ:Type) = let etys = typ.GetGenericArguments() let maker1 = getTupleCtor (typ,BindingFlags.Public) @@ -606,20 +645,25 @@ module internal Impl = else maker1,Some(etys.[tupleEncField]) - let getTupleReaderInfo (typ:Type,index:int) = + let getTupleReaderInfo (typ:Type,index:int) = if index < 0 then invalidArg "index" (SR.GetString2(SR.tupleIndexOutOfRange, typ.FullName, index.ToString())) - let props = typ.GetProperties(instancePropertyFlags ||| BindingFlags.Public) |> orderTupleProperties - let get index = - if index >= props.Length then invalidArg "index" (SR.GetString2(SR.tupleIndexOutOfRange, typ.FullName, index.ToString())) - props.[index] - + + let get index = + if typ.IsValueType then + let props = typ.GetProperties(instancePropertyFlags ||| BindingFlags.Public) |> orderTupleProperties + if index >= props.Length then invalidArg "index" (SR.GetString2(SR.tupleIndexOutOfRange, typ.FullName, index.ToString())) + props.[index] + else + let props = typ.GetProperties(instancePropertyFlags ||| BindingFlags.Public) |> orderTupleProperties + if index >= props.Length then invalidArg "index" (SR.GetString2(SR.tupleIndexOutOfRange, typ.FullName, index.ToString())) + props.[index] + if index < tupleEncField then - get index, None + get index, None else let etys = typ.GetGenericArguments() get tupleEncField, Some(etys.[tupleEncField],index-(maxTuple-1)) - - + //----------------------------------------------------------------- // FUNCTION DECOMPILATION From 8efcf96eb418666bddac140940f8ff7ee6054ab4 Mon Sep 17 00:00:00 2001 From: KevinRansom Date: Mon, 11 Jul 2016 06:58:59 -0700 Subject: [PATCH 3/5] Attempt to emit field access rather than property access. --- src/fsharp/FSharp.Core/reflect.fs | 2 +- src/fsharp/IlxGen.fs | 4 ++-- src/fsharp/TastOps.fs | 12 +++++++++--- src/fsharp/TastOps.fsi | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/fsharp/FSharp.Core/reflect.fs b/src/fsharp/FSharp.Core/reflect.fs index 6382f117abd..2c4f24edb1e 100644 --- a/src/fsharp/FSharp.Core/reflect.fs +++ b/src/fsharp/FSharp.Core/reflect.fs @@ -396,7 +396,7 @@ module internal Impl = let mutable systemValueTupleException = null let reflectedValueTuple n = - try + try #if FX_ASSEMBLYLOADBYSTRING let a = Assembly.Load("System.ValueTuple") #else diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index 15a95f354ae..ac7f7204075 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -2010,7 +2010,7 @@ and GenGetTupleField cenv cgbuf eenv (tupInfo,e,tys,n,m) sequel = elif ar < maxTuple then let tcr' = mkCompiledTupleTyconRef g tupInfo tys let typ = GenNamedTyApp cenv.amap m g eenv.tyenv tcr' tys - mkGetTupleItemN g m n typ e tys.[n] + mkGetTupleItemN g m n typ tupInfo e tys.[n] else let tysA,tysB = List.splitAfter (goodTupleFields) tys let tyB = mkCompiledTupleTy g tupInfo tysB @@ -2018,7 +2018,7 @@ and GenGetTupleField cenv cgbuf eenv (tupInfo,e,tys,n,m) sequel = let tcr' = mkCompiledTupleTyconRef g tupInfo tys' let typ' = GenNamedTyApp cenv.amap m g eenv.tyenv tcr' tys' let n' = (min n goodTupleFields) - let elast = mkGetTupleItemN g m n' typ' e tys'.[n'] + let elast = mkGetTupleItemN g m n' typ' tupInfo e tys'.[n'] if n < goodTupleFields then elast else diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 47d7a33cacc..dcad246bb72 100755 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -624,7 +624,7 @@ let reduceTyconMeasureableOrProvided g (tycon:Tycon) tyargs = | TProvidedTypeExtensionPoint info when info.IsErased -> info.BaseTypeForErased (range0, g.obj_ty) #endif | _ -> invalidArg "tc" "this type definition is not a refinement" - + let reduceTyconRefMeasureableOrProvided (g:TcGlobals) (tcref:TyconRef) tyargs = reduceTyconMeasureableOrProvided g tcref.Deref tyargs @@ -7826,8 +7826,14 @@ let rec mkCompiledTuple g isStruct (argtys,args,m) = let mkILMethodSpecForTupleItem (_g : TcGlobals) (typ:ILType) n = mkILNonGenericInstanceMethSpecInTy(typ, (if n < goodTupleFields then "get_Item"+(n+1).ToString() else "get_Rest"), [], mkILTyvarTy (uint16 n)) -let mkGetTupleItemN g m n typ te retty = - mkAsmExpr([IL.mkNormalCall(mkILMethodSpecForTupleItem g typ n)],[],[te],[retty],m) +let mkILFieldSpecForTupleItem typ n = + mkILFieldSpecInTy (typ,(if n < goodTupleFields then "Item"+(n+1).ToString() else "Rest"), mkILTyvarTy (uint16 n)) + +let mkGetTupleItemN g m n (typ:ILType) isStruct te retty = + if isStruct then + mkAsmExpr([mkNormalLdfld (mkILFieldSpecForTupleItem typ n) ],[],[],[retty],m) + else + mkAsmExpr([IL.mkNormalCall(mkILMethodSpecForTupleItem g typ n)],[],[te],[retty],m) /// Match an Int32 constant expression let (|Int32Expr|_|) expr = diff --git a/src/fsharp/TastOps.fsi b/src/fsharp/TastOps.fsi index 31e51d45155..d8ae111537e 100755 --- a/src/fsharp/TastOps.fsi +++ b/src/fsharp/TastOps.fsi @@ -230,7 +230,7 @@ val isCompiledTupleTyconRef : TcGlobals -> TyconRef -> bool val mkCompiledTupleTyconRef : TcGlobals -> bool -> 'a list -> TyconRef val mkCompiledTupleTy : TcGlobals -> bool -> TTypes -> TType val mkCompiledTuple : TcGlobals -> bool -> TTypes * Exprs * range -> TyconRef * TTypes * Exprs * range -val mkGetTupleItemN : TcGlobals -> range -> int -> ILType -> Expr -> TType -> Expr +val mkGetTupleItemN : TcGlobals -> range -> int -> ILType -> bool -> Expr -> TType -> Expr val evalTupInfoIsStruct : TupInfo -> bool From 1239cd027d997ab4ef79055643fa980a2ae1c7b4 Mon Sep 17 00:00:00 2001 From: KevinRansom Date: Mon, 18 Jul 2016 08:37:30 -0700 Subject: [PATCH 4/5] Diagnostic junk --- src/absil/il.fs | 2 +- src/absil/ilwrite.fs | 2 ++ src/fsharp/IlxGen.fs | 16 ++++++++++------ src/fsharp/TastOps.fs | 9 ++++++--- src/fsharp/tast.fs | 14 ++++++++++++-- 5 files changed, 31 insertions(+), 12 deletions(-) diff --git a/src/absil/il.fs b/src/absil/il.fs index 5a0cdee0b60..09de6d39107 100755 --- a/src/absil/il.fs +++ b/src/absil/il.fs @@ -1987,7 +1987,7 @@ let mkILFieldRef(tref,nm,ty) = { EnclosingTypeRef=tref; Name=nm; Type=ty} let mkILFieldSpec (tref,ty) = { FieldRef= tref; EnclosingType=ty } let mkILFieldSpecInTy (typ:ILType,nm,fty) = - mkILFieldSpec (mkILFieldRef (typ.TypeRef,nm,fty), typ) + mkILFieldSpec (mkILFieldRef (typ.TypeRef,nm,fty), typ) let emptyILCustomAttrs = ILAttributes (fun () -> [| |]) diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs index 993b78959b7..2d90d7c60b7 100644 --- a/src/absil/ilwrite.fs +++ b/src/absil/ilwrite.fs @@ -1466,6 +1466,8 @@ and GetFieldSpecSigAsBlobIdx cenv env x = and GetFieldSpecAsFieldDefOrRef cenv env (fspec:ILFieldSpec) = let typ = fspec.EnclosingType + printfn "Here: %A" typ.BasicQualifiedName + printfn " : %A" typ.GenericArgs if isTypeLocal typ then if not typ.IsNominal then failwith "GetFieldSpecAsFieldDefOrRef: unexpected local tref-typ" let tref = typ.TypeRef diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index ac7f7204075..83d57acba48 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -390,20 +390,25 @@ let rec GenTypeArgAux amap m g tyenv tyarg = and GenTypeArgsAux amap m g tyenv tyargs = List.map (GenTypeArgAux amap m g tyenv) (DropErasedTyargs tyargs) -and GenTyAppAux amap m g tyenv repr tinst = +and GenTyAppAux amap m g tyenv repr tinst = + printfn "BBBBB" match repr with | CompiledTypeRepr.ILAsmOpen ty -> + printfn "CCCCC" let ilTypeInst = GenTypeArgsAux amap m g tyenv tinst let ty = IL.instILType (ILList.ofList ilTypeInst) ty ty | CompiledTypeRepr.ILAsmNamed (tref, boxity, ilTypeOpt) -> + printfn "DDDDD" match ilTypeOpt with | None -> + printfn "EEEEE" let ilTypeInst = GenTypeArgsAux amap m g tyenv tinst mkILTy boxity (mkILTySpec (tref,ilTypeInst)) | Some ilType -> + printfn "FFFFF" ilType // monomorphic types include a cached ilType to avoid reallocation of an ILType node - + and GenNamedTyAppAux (amap:Import.ImportMap) m g tyenv ptrsOK tcref tinst = let tinst = DropErasedTyargs tinst @@ -428,7 +433,7 @@ and GenTypeAux amap m g (tyenv: TypeReprEnv) voidOK ptrsOK ty = #endif match stripTyEqnsAndMeasureEqns g ty with | TType_app (tcref, tinst) -> GenNamedTyAppAux amap m g tyenv ptrsOK tcref tinst - | TType_tuple (tupInfo, args) -> GenTypeAux amap m g tyenv VoidNotOK ptrsOK (mkCompiledTupleTy g (evalTupInfoIsStruct tupInfo) args) + | TType_tuple (tupInfo, args) -> printfn "AAAA"; GenTypeAux amap m g tyenv VoidNotOK ptrsOK (mkCompiledTupleTy g (evalTupInfoIsStruct tupInfo) args) | TType_fun (dty, returnTy) -> EraseClosures.mkILFuncTy g.ilxPubCloEnv (GenTypeArgAux amap m g tyenv dty) (GenTypeArgAux amap m g tyenv returnTy) | TType_ucase (ucref, args) -> @@ -2009,8 +2014,8 @@ and GenGetTupleField cenv cgbuf eenv (tupInfo,e,tys,n,m) sequel = if ar <= 0 then failwith "getCompiledTupleItem" elif ar < maxTuple then let tcr' = mkCompiledTupleTyconRef g tupInfo tys - let typ = GenNamedTyApp cenv.amap m g eenv.tyenv tcr' tys - mkGetTupleItemN g m n typ tupInfo e tys.[n] + let typ' = GenNamedTyApp cenv.amap m g eenv.tyenv tcr' tys + mkGetTupleItemN g m n typ' tupInfo e tys.[n] else let tysA,tysB = List.splitAfter (goodTupleFields) tys let tyB = mkCompiledTupleTy g tupInfo tysB @@ -2025,7 +2030,6 @@ and GenGetTupleField cenv cgbuf eenv (tupInfo,e,tys,n,m) sequel = getCompiledTupleItem g (elast,tysB,n-goodTupleFields,m) GenExpr cenv cgbuf eenv SPSuppress (getCompiledTupleItem cenv.g (e,tys,n,m)) sequel - and GenAllocExn cenv cgbuf eenv (c,args,m) sequel = GenExprs cenv cgbuf eenv args let typ = GenExnType cenv.amap m cenv.g eenv.tyenv c diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index dcad246bb72..e5dd0f2682d 100755 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -7826,12 +7826,15 @@ let rec mkCompiledTuple g isStruct (argtys,args,m) = let mkILMethodSpecForTupleItem (_g : TcGlobals) (typ:ILType) n = mkILNonGenericInstanceMethSpecInTy(typ, (if n < goodTupleFields then "get_Item"+(n+1).ToString() else "get_Rest"), [], mkILTyvarTy (uint16 n)) -let mkILFieldSpecForTupleItem typ n = - mkILFieldSpecInTy (typ,(if n < goodTupleFields then "Item"+(n+1).ToString() else "Rest"), mkILTyvarTy (uint16 n)) +let mkILFieldSpecForTupleItem (typ:ILType) n = + printfn "mkILFieldSpecForTupleItem: %A" typ.BasicQualifiedName + printfn "mkILFieldSpecForTupleItem: %A" typ.TypeRef.BasicQualifiedName + typ.GenericArgs |> Seq.iter(fun t -> printfn ">>>>> %A" t.BasicQualifiedName) + mkILFieldSpecInTy (typ,(if n < goodTupleFields then "Item"+(n+1).ToString() else "Rest"), mkILTyvarTy (uint16 (n + 1) )) let mkGetTupleItemN g m n (typ:ILType) isStruct te retty = if isStruct then - mkAsmExpr([mkNormalLdfld (mkILFieldSpecForTupleItem typ n) ],[],[],[retty],m) + mkAsmExpr([mkNormalLdfld (mkILFieldSpecForTupleItem typ n) ],[],[te],[retty],m) else mkAsmExpr([IL.mkNormalCall(mkILMethodSpecForTupleItem g typ n)],[],[te],[retty],m) diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs index 06ead64384a..03baed691a0 100755 --- a/src/fsharp/tast.fs +++ b/src/fsharp/tast.fs @@ -917,11 +917,15 @@ type Entity = let st = info.ProvidedType let tref = ExtensionTyping.GetILTypeRefOfProvidedType (st, x.Range) let boxity = if x.IsStructOrEnumTycon then AsValue else AsObject + printfn "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" CompiledTypeRepr.ILAsmNamed(tref, boxity, None) | TProvidedNamespaceExtensionPoint _ -> failwith "No compiled representation for provided namespace" | _ -> #endif let ilTypeRefForCompilationPath (CompPath(sref,p)) item = + printfn "sref : %A" sref + printfn "p : %A" p + printfn "item : %A" item let rec top racc p = match p with | [] -> ILTypeRef.Create(sref,[],textOfPath (List.rev (item::racc))) @@ -952,8 +956,14 @@ type Entity = let ilTypeOpt = match x.TyparsNoRange with | [] -> Some (mkILTy boxity (mkILTySpec (ilTypeRef,[]))) - | _ -> None - CompiledTypeRepr.ILAsmNamed (ilTypeRef, boxity, ilTypeOpt)) + | _ -> None //Some (mkILTy boxity (mkILTySpec (ilTypeRef,x))) + printfn "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + printfn "%A" ilTypeRef + printfn "%A" boxity + printfn "%A" ilTypeOpt + let x = CompiledTypeRepr.ILAsmNamed (ilTypeRef, boxity, ilTypeOpt) + printfn "%A" x + x) /// Gets the data indicating the compiled representation of a named type or module in terms of Abstract IL data structures. member x.CompiledRepresentationForNamedType = From 6db1b99f451d941ca2b6d01de924e5b950d680e4 Mon Sep 17 00:00:00 2001 From: KevinRansom Date: Mon, 18 Jul 2016 12:35:18 -0700 Subject: [PATCH 5/5] Remove printfn tracingdiagnostics --- src/absil/ilwrite.fs | 2 -- src/fsharp/IlxGen.fs | 7 +------ src/fsharp/tast.fs | 14 ++------------ 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs index 2d90d7c60b7..993b78959b7 100644 --- a/src/absil/ilwrite.fs +++ b/src/absil/ilwrite.fs @@ -1466,8 +1466,6 @@ and GetFieldSpecSigAsBlobIdx cenv env x = and GetFieldSpecAsFieldDefOrRef cenv env (fspec:ILFieldSpec) = let typ = fspec.EnclosingType - printfn "Here: %A" typ.BasicQualifiedName - printfn " : %A" typ.GenericArgs if isTypeLocal typ then if not typ.IsNominal then failwith "GetFieldSpecAsFieldDefOrRef: unexpected local tref-typ" let tref = typ.TypeRef diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index 89ab0831dcf..e1b689da27d 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -391,22 +391,17 @@ and GenTypeArgsAux amap m g tyenv tyargs = List.map (GenTypeArgAux amap m g tyenv) (DropErasedTyargs tyargs) and GenTyAppAux amap m g tyenv repr tinst = - printfn "BBBBB" match repr with | CompiledTypeRepr.ILAsmOpen ty -> - printfn "CCCCC" let ilTypeInst = GenTypeArgsAux amap m g tyenv tinst let ty = IL.instILType (ILList.ofList ilTypeInst) ty ty | CompiledTypeRepr.ILAsmNamed (tref, boxity, ilTypeOpt) -> - printfn "DDDDD" match ilTypeOpt with | None -> - printfn "EEEEE" let ilTypeInst = GenTypeArgsAux amap m g tyenv tinst mkILTy boxity (mkILTySpec (tref,ilTypeInst)) | Some ilType -> - printfn "FFFFF" ilType // monomorphic types include a cached ilType to avoid reallocation of an ILType node @@ -433,7 +428,7 @@ and GenTypeAux amap m g (tyenv: TypeReprEnv) voidOK ptrsOK ty = #endif match stripTyEqnsAndMeasureEqns g ty with | TType_app (tcref, tinst) -> GenNamedTyAppAux amap m g tyenv ptrsOK tcref tinst - | TType_tuple (tupInfo, args) -> printfn "AAAA"; GenTypeAux amap m g tyenv VoidNotOK ptrsOK (mkCompiledTupleTy g (evalTupInfoIsStruct tupInfo) args) + | TType_tuple (tupInfo, args) -> GenTypeAux amap m g tyenv VoidNotOK ptrsOK (mkCompiledTupleTy g (evalTupInfoIsStruct tupInfo) args) | TType_fun (dty, returnTy) -> EraseClosures.mkILFuncTy g.ilxPubCloEnv (GenTypeArgAux amap m g tyenv dty) (GenTypeArgAux amap m g tyenv returnTy) | TType_ucase (ucref, args) -> diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs index 03baed691a0..aea9de0b56b 100755 --- a/src/fsharp/tast.fs +++ b/src/fsharp/tast.fs @@ -917,15 +917,11 @@ type Entity = let st = info.ProvidedType let tref = ExtensionTyping.GetILTypeRefOfProvidedType (st, x.Range) let boxity = if x.IsStructOrEnumTycon then AsValue else AsObject - printfn "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" CompiledTypeRepr.ILAsmNamed(tref, boxity, None) | TProvidedNamespaceExtensionPoint _ -> failwith "No compiled representation for provided namespace" | _ -> #endif let ilTypeRefForCompilationPath (CompPath(sref,p)) item = - printfn "sref : %A" sref - printfn "p : %A" p - printfn "item : %A" item let rec top racc p = match p with | [] -> ILTypeRef.Create(sref,[],textOfPath (List.rev (item::racc))) @@ -956,14 +952,8 @@ type Entity = let ilTypeOpt = match x.TyparsNoRange with | [] -> Some (mkILTy boxity (mkILTySpec (ilTypeRef,[]))) - | _ -> None //Some (mkILTy boxity (mkILTySpec (ilTypeRef,x))) - printfn "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" - printfn "%A" ilTypeRef - printfn "%A" boxity - printfn "%A" ilTypeOpt - let x = CompiledTypeRepr.ILAsmNamed (ilTypeRef, boxity, ilTypeOpt) - printfn "%A" x - x) + | _ -> None + CompiledTypeRepr.ILAsmNamed (ilTypeRef, boxity, ilTypeOpt)) /// Gets the data indicating the compiled representation of a named type or module in terms of Abstract IL data structures. member x.CompiledRepresentationForNamedType =