From 9690bd36d58d128537b297660891cdc69f70c0d4 Mon Sep 17 00:00:00 2001 From: Vasily Kirichenko Date: Sat, 14 Oct 2017 18:13:51 +0300 Subject: [PATCH 1/3] fix IL types constructors nice print --- src/fsharp/NicePrint.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs index bf05dcadab2..2b97a6e8b30 100755 --- a/src/fsharp/NicePrint.fs +++ b/src/fsharp/NicePrint.fs @@ -1299,7 +1299,7 @@ module InfoMemberPrinting = // Container(argName1:argType1, ..., argNameN:argTypeN) : retType // Container.Method(argName1:argType1, ..., argNameN:argTypeN) : retType let private layoutMethInfoCSharpStyle amap m denv (minfo:MethInfo) minst = - let retTy = minfo.GetFSharpReturnTy(amap, m, minst) + let retTy = if minfo.IsConstructor || minfo.IsClassConstructor then minfo.EnclosingType else minfo.GetFSharpReturnTy(amap, m, minst) let layout = if minfo.IsExtensionMember then LeftL.leftParen ^^ wordL (tagKeyword (FSComp.SR.typeInfoExtension())) ^^ RightL.rightParen From 576affb2b369bcaa590cf15589a383b5fbb9fa8a Mon Sep 17 00:00:00 2001 From: Vasily Kirichenko Date: Sat, 14 Oct 2017 20:08:16 +0300 Subject: [PATCH 2/3] fix a test --- tests/fsharp/typecheck/sigs/neg20.bsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fsharp/typecheck/sigs/neg20.bsl b/tests/fsharp/typecheck/sigs/neg20.bsl index bd7559f382a..fc46431486b 100644 --- a/tests/fsharp/typecheck/sigs/neg20.bsl +++ b/tests/fsharp/typecheck/sigs/neg20.bsl @@ -349,9 +349,9 @@ neg20.fs(319,8,319,17): typecheck error FS3132: This type definition may not hav neg20.fs(322,8,322,18): typecheck error FS3132: This type definition may not have the 'CLIMutable' attribute. Only record types may have this attribute. -neg20.fs(335,11,335,24): typecheck error FS0041: A unique overload for method 'String' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: System.String(value: char []) : unit, System.String(value: nativeptr) : unit, System.String(value: nativeptr) : unit +neg20.fs(335,11,335,24): typecheck error FS0041: A unique overload for method 'String' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: System.String(value: char []) : System.String, System.String(value: nativeptr) : System.String, System.String(value: nativeptr) : System.String -neg20.fs(336,11,336,22): typecheck error FS0041: A unique overload for method 'Guid' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: System.Guid(b: byte []) : unit, System.Guid(g: string) : unit +neg20.fs(336,11,336,22): typecheck error FS0041: A unique overload for method 'Guid' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: System.Guid(b: byte []) : System.Guid, System.Guid(g: string) : System.Guid neg20.fs(355,19,355,38): typecheck error FS1124: Multiple types exist called 'OverloadedClassName', taking different numbers of generic parameters. Provide a type instantiation to disambiguate the type resolution, e.g. 'OverloadedClassName<_>'. From d289316cfda85a0089952f7d964bb42b9d82d225 Mon Sep 17 00:00:00 2001 From: Vasily Kirichenko Date: Sat, 14 Oct 2017 22:52:50 +0300 Subject: [PATCH 3/3] static constructors do not return anything --- src/fsharp/NicePrint.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs index 2b97a6e8b30..2387b0365c3 100755 --- a/src/fsharp/NicePrint.fs +++ b/src/fsharp/NicePrint.fs @@ -1299,7 +1299,7 @@ module InfoMemberPrinting = // Container(argName1:argType1, ..., argNameN:argTypeN) : retType // Container.Method(argName1:argType1, ..., argNameN:argTypeN) : retType let private layoutMethInfoCSharpStyle amap m denv (minfo:MethInfo) minst = - let retTy = if minfo.IsConstructor || minfo.IsClassConstructor then minfo.EnclosingType else minfo.GetFSharpReturnTy(amap, m, minst) + let retTy = if minfo.IsConstructor then minfo.EnclosingType else minfo.GetFSharpReturnTy(amap, m, minst) let layout = if minfo.IsExtensionMember then LeftL.leftParen ^^ wordL (tagKeyword (FSComp.SR.typeInfoExtension())) ^^ RightL.rightParen