From ffeeabd9f7330ca6bf3fbb51daf1847ea5fe3a67 Mon Sep 17 00:00:00 2001 From: mpetruska Date: Sat, 2 Jan 2016 16:41:40 +0000 Subject: [PATCH 1/4] partially fixes Intellisense after type constraint error --- src/fsharp/TypeChecker.fs | 26 ++++++++++++++----- .../Tests.LanguageService.Completion.fs | 14 ++++++++++ 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 5de87a6d997..ca6db8d88a8 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -3906,7 +3906,7 @@ type DelayedItem = /// DelayedApp (isAtomic, argExpr, mFuncAndArg) /// - /// Represents the args in "item args", or "item.[args]". + /// Represents the args in "item args", or "item.[args]". | DelayedApp of ExprAtomicFlag * Ast.SynExpr * range /// Represents the long identifiers in "item.Ident1", or "item.Ident1.Ident2" etc. @@ -5323,7 +5323,18 @@ and RecordNameAndTypeResolutions_IdeallyWithoutHavingOtherEffects_Delayed cenv e RecordNameAndTypeResolutions_IdeallyWithoutHavingOtherEffects cenv env tpenv arg dummyCheckedDelayed otherDelayed | _ -> () - dummyCheckedDelayed delayed + + dummyCheckedDelayed delayed + +// Calls UnifyTypes, records name resolutions on failure, so that type information +// can be collected for IntelliSense. +and UnifyTypes_RecordNameResolutionsOnError cenv env m expectedTy actualTy tpenv delayed = + try + UnifyTypes cenv env m expectedTy actualTy + with + _ -> + RecordNameAndTypeResolutions_IdeallyWithoutHavingOtherEffects_Delayed cenv env tpenv delayed + reraise() and TcExprOfUnknownType cenv env tpenv expr = let exprty = NewInferenceType () @@ -8088,8 +8099,8 @@ and PropagateThenTcDelayed cenv overallTy env tpenv mExpr expr exprty (atomicFla match delayedList with | [] -> // Avoid unifying twice: we're about to unify in TcDelayed - if not (isNil delayed) then - UnifyTypes cenv env mExpr overallTy exprty + if not (isNil delayed) then + UnifyTypes_RecordNameResolutionsOnError cenv env mExpr overallTy exprty tpenv delayed | DelayedDot :: _ | DelayedSet _ :: _ | DelayedDotLookup _ :: _ -> () @@ -8108,7 +8119,7 @@ and PropagateThenTcDelayed cenv overallTy env tpenv mExpr expr exprty (atomicFla | SynExpr.CompExpr _ -> () | _ -> // 'delayed' is about to be dropped on the floor, first do rudimentary checking to get name resolutions in its body - RecordNameAndTypeResolutions_IdeallyWithoutHavingOtherEffects_Delayed cenv env tpenv delayed + RecordNameAndTypeResolutions_IdeallyWithoutHavingOtherEffects_Delayed cenv env tpenv delayed error (NotAFunction(denv,overallTy,mExpr,mArg)) propagate delayed expr.Range exprty @@ -8127,7 +8138,8 @@ and TcDelayed cenv overallTy env tpenv mExpr expr exprty (atomicFlag:ExprAtomicF match delayed with | [] | DelayedDot :: _ -> - UnifyTypes cenv env mExpr overallTy exprty; expr.Expr,tpenv + UnifyTypes_RecordNameResolutionsOnError cenv env mExpr overallTy exprty tpenv delayed + expr.Expr,tpenv // expr.M(args) where x.M is a .NET method or index property // expr.M(args) where x.M is a .NET method or index property // expr.M where x.M is a .NET method or index property @@ -8689,7 +8701,7 @@ and TcItemThen cenv overallTy env tpenv (item,mItem,rest,afterOverloadResolution | Item.CustomOperation (nm,usageTextOpt,_) -> // 'delayed' is about to be dropped on the floor, first do rudimentary checking to get name resolutions in its body - RecordNameAndTypeResolutions_IdeallyWithoutHavingOtherEffects_Delayed cenv env tpenv delayed + RecordNameAndTypeResolutions_IdeallyWithoutHavingOtherEffects_Delayed cenv env tpenv delayed match usageTextOpt() with | None -> error(Error(FSComp.SR.tcCustomOperationNotUsedCorrectly(nm), mItem)) | Some usageText -> error(Error(FSComp.SR.tcCustomOperationNotUsedCorrectly2(nm,usageText), mItem)) diff --git a/vsintegration/tests/unittests/Tests.LanguageService.Completion.fs b/vsintegration/tests/unittests/Tests.LanguageService.Completion.fs index 5176ed0eaab..e8da0efe48c 100644 --- a/vsintegration/tests/unittests/Tests.LanguageService.Completion.fs +++ b/vsintegration/tests/unittests/Tests.LanguageService.Completion.fs @@ -467,6 +467,20 @@ type UsingMSBuild() as this = AssertCtrlSpaceCompleteContains code "b a" ["aaa"; "bbb"] [] AssertCtrlSpaceCompleteContains code "a b" ["aaa"; "bbb"] [] + [] + member this.``AutoCompletion.OnTypeConstraintError``() = + let code = + [ + "type Foo = Foo" + " with" + " member __.Bar = 1" + " member __.SomeMethodForIntellisense() = 2" + "" + "let u: Unit =" + " [ Foo ]" + " |> List.map (fun abcd -> abcd.)" + ] + AssertCtrlSpaceCompleteContains code "abcd." ["GetType"; "ToString"] [] [] [] From ac1fe48121dd66bd930d77b40cff89e98b0c48d7 Mon Sep 17 00:00:00 2001 From: liboz Date: Fri, 30 Sep 2016 17:54:50 -0400 Subject: [PATCH 2/4] working with intellisense --- src/fsharp/TypeChecker.fs | 19 ++++++++----------- .../Tests.LanguageService.Completion.fs | 8 +++++--- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index ca6db8d88a8..509f310fe7c 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -5323,18 +5323,15 @@ and RecordNameAndTypeResolutions_IdeallyWithoutHavingOtherEffects_Delayed cenv e RecordNameAndTypeResolutions_IdeallyWithoutHavingOtherEffects cenv env tpenv arg dummyCheckedDelayed otherDelayed | _ -> () - dummyCheckedDelayed delayed -// Calls UnifyTypes, records name resolutions on failure, so that type information -// can be collected for IntelliSense. -and UnifyTypes_RecordNameResolutionsOnError cenv env m expectedTy actualTy tpenv delayed = +// Calls UnifyTypes, but upon error only does the minimal error recovery +// so that IntelliSense information can continue to be collected. +and UnifyTypesAndRecover cenv env m expectedTy actualTy = try UnifyTypes cenv env m expectedTy actualTy - with - _ -> - RecordNameAndTypeResolutions_IdeallyWithoutHavingOtherEffects_Delayed cenv env tpenv delayed - reraise() + with e -> + errorRecovery e m and TcExprOfUnknownType cenv env tpenv expr = let exprty = NewInferenceType () @@ -8099,8 +8096,8 @@ and PropagateThenTcDelayed cenv overallTy env tpenv mExpr expr exprty (atomicFla match delayedList with | [] -> // Avoid unifying twice: we're about to unify in TcDelayed - if not (isNil delayed) then - UnifyTypes_RecordNameResolutionsOnError cenv env mExpr overallTy exprty tpenv delayed + if not (isNil delayed) then + UnifyTypesAndRecover cenv env mExpr overallTy exprty | DelayedDot :: _ | DelayedSet _ :: _ | DelayedDotLookup _ :: _ -> () @@ -8138,7 +8135,7 @@ and TcDelayed cenv overallTy env tpenv mExpr expr exprty (atomicFlag:ExprAtomicF match delayed with | [] | DelayedDot :: _ -> - UnifyTypes_RecordNameResolutionsOnError cenv env mExpr overallTy exprty tpenv delayed + UnifyTypesAndRecover cenv env mExpr overallTy exprty expr.Expr,tpenv // expr.M(args) where x.M is a .NET method or index property // expr.M(args) where x.M is a .NET method or index property diff --git a/vsintegration/tests/unittests/Tests.LanguageService.Completion.fs b/vsintegration/tests/unittests/Tests.LanguageService.Completion.fs index e8da0efe48c..4fcd2e6a977 100644 --- a/vsintegration/tests/unittests/Tests.LanguageService.Completion.fs +++ b/vsintegration/tests/unittests/Tests.LanguageService.Completion.fs @@ -474,13 +474,15 @@ type UsingMSBuild() as this = "type Foo = Foo" " with" " member __.Bar = 1" - " member __.SomeMethodForIntellisense() = 2" + " member __.PublicMethodForIntellisense() = 2" + " member internal __.InternalMethod() = 3" + " member private __.PrivateProperty = 4" "" "let u: Unit =" " [ Foo ]" " |> List.map (fun abcd -> abcd.)" ] - AssertCtrlSpaceCompleteContains code "abcd." ["GetType"; "ToString"] [] + AssertCtrlSpaceCompleteContains code "abcd." ["Bar"; "Equals"; "GetHashCode"; "GetType"; "InternalMethod"; "PublicMethodForIntellisense"; "ToString"] [] [] [] @@ -5764,7 +5766,7 @@ let rec f l = type IFoo = abstract DoStuff : unit -> string abstract DoStuff2 : int * int -> string -> string - // Implement an interface in a class (This is kind of lame if you don’t want to actually declare a class) + // Implement an interface in a class (This is kind of lame if you don't want to actually declare a class) type Foo() = interface IFoo with member this.DoStuff () = "Return a string" From e2b2a22d84c98be993c01e3c8014a351363e8597 Mon Sep 17 00:00:00 2001 From: liboz Date: Fri, 30 Sep 2016 22:52:33 -0400 Subject: [PATCH 3/4] fix tests --- tests/fsharp/typeProviders/negTests/neg1.bsl | 6 + tests/fsharp/typecheck/sigs/neg04.bsl | 8 + tests/fsharp/typecheck/sigs/neg20.bsl | 20 ++ tests/fsharp/typecheck/sigs/neg22.bsl | 12 ++ .../CheckingSyntacticTypes/E_Regression02.fs | 188 ++++++++++++------ 5 files changed, 172 insertions(+), 62 deletions(-) diff --git a/tests/fsharp/typeProviders/negTests/neg1.bsl b/tests/fsharp/typeProviders/negTests/neg1.bsl index 64fd3e58aef..668eec00e10 100644 --- a/tests/fsharp/typeProviders/negTests/neg1.bsl +++ b/tests/fsharp/typeProviders/negTests/neg1.bsl @@ -1966,16 +1966,22 @@ neg1.fsx(438,109,438,110): typecheck error FS0001: This expression was expected but here has type 'string' +neg1.fsx(438,9,438,111): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(440,119,440,120): typecheck error FS0001: This expression was expected to have type 'int' but here has type 'string' +neg1.fsx(440,19,440,121): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(440,119,440,120): typecheck error FS0001: This expression was expected to have type 'int' but here has type 'string' +neg1.fsx(440,19,440,121): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(448,9,448,107): typecheck error FS3148: Too many static parameters. Expected at most 1 parameters, but got 2 unnamed and 0 named parameters. neg1.fsx(449,105,449,110): typecheck error FS3083: The static parameter 'Count' has already been given a value diff --git a/tests/fsharp/typecheck/sigs/neg04.bsl b/tests/fsharp/typecheck/sigs/neg04.bsl index e32b4fb0154..72a8ee16dd6 100644 --- a/tests/fsharp/typecheck/sigs/neg04.bsl +++ b/tests/fsharp/typecheck/sigs/neg04.bsl @@ -31,6 +31,14 @@ but given a ''g list -> 'h' The type 'seq<'a>' does not match the type ''f list' +neg04.fs(47,49,47,51): typecheck error FS0784: This numeric literal requires that a module 'NumericLiteralN' defining functions FromZero, FromOne, FromInt32, FromInt64 and FromString be in scope + +neg04.fs(47,30,47,51): typecheck error FS0001: Type mismatch. Expecting a + 'seq<'a> -> 'f' +but given a + ''g list -> 'h' +The type 'seq<'a>' does not match the type ''f list' + neg04.fs(61,25,61,40): typecheck error FS0001: This expression was expected to have type 'ClassType1' but here has type diff --git a/tests/fsharp/typecheck/sigs/neg20.bsl b/tests/fsharp/typecheck/sigs/neg20.bsl index 8c593a51bf4..1ac552867f3 100644 --- a/tests/fsharp/typecheck/sigs/neg20.bsl +++ b/tests/fsharp/typecheck/sigs/neg20.bsl @@ -245,6 +245,16 @@ neg20.fs(184,28,184,33): typecheck error FS0001: This expression was expected to but here has type 'obj' +neg20.fs(184,28,184,33): typecheck error FS0001: This expression was expected to have type + 'int' +but here has type + 'obj' + +neg20.fs(184,34,184,39): typecheck error FS0001: This expression was expected to have type + 'int' +but here has type + 'obj' + neg20.fs(184,34,184,39): typecheck error FS0001: This expression was expected to have type 'int' but here has type @@ -272,6 +282,16 @@ neg20.fs(190,28,190,33): typecheck error FS0001: This expression was expected to but here has type 'obj' +neg20.fs(190,28,190,33): typecheck error FS0001: This expression was expected to have type + 'string' +but here has type + 'obj' + +neg20.fs(190,34,190,39): typecheck error FS0001: This expression was expected to have type + 'string' +but here has type + 'obj' + neg20.fs(190,34,190,39): typecheck error FS0001: This expression was expected to have type 'string' but here has type diff --git a/tests/fsharp/typecheck/sigs/neg22.bsl b/tests/fsharp/typecheck/sigs/neg22.bsl index 502aa7cc8bd..a408371e221 100644 --- a/tests/fsharp/typecheck/sigs/neg22.bsl +++ b/tests/fsharp/typecheck/sigs/neg22.bsl @@ -21,6 +21,18 @@ but given a 'float' The unit of measure 'm' does not match the unit of measure 'kg' +neg22.fs(17,22,17,29): typecheck error FS0001: Type mismatch. Expecting a + 'float' +but given a + 'float' +The unit of measure 'm' does not match the unit of measure 'kg' + +neg22.fs(17,20,17,29): typecheck error FS0001: Type mismatch. Expecting a + 'float' +but given a + 'float' +The unit of measure 'm' does not match the unit of measure 'kg' + neg22.fs(28,12,28,18): typecheck error FS0957: The declared type parameters for this type extension do not match the declared type parameters on the original type 'LibGen<_>' neg22.fs(40,12,40,18): typecheck error FS0957: The declared type parameters for this type extension do not match the declared type parameters on the original type 'LibGen<_>' diff --git a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs index 9e21caf6bfa..ebefa1eecf1 100644 --- a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs +++ b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs @@ -1,70 +1,134 @@ // #Regression #Conformance #TypeConstraints // Regression test for CTP bug reported at http://cs.hubfs.net/forums/thread/9313.aspx // In CTP, this was a stack overflow in the compiler. Now we give 64 errors -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' -//The type 'uint32' does not match the type 'int32' +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined //The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined //The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P3' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P3' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P3' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P3' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P3' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P3' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P3' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P3' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P3' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P3' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P3' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P3' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P3' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P3' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P3' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P3' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P4' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P4' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P4' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P4' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P4' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P4' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P4' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P4' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P4' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P4' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P4' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P4' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P4' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P4' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P4' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P4' is not defined module SmartHashUtils = let ByteToUInt (array:byte[]) offset length endian = From 82fbc605c25bfd835fc3657e4e656f085c11b992 Mon Sep 17 00:00:00 2001 From: liboz Date: Sat, 1 Oct 2016 00:43:23 -0400 Subject: [PATCH 4/4] exits on too many errors, remove some of the expected error messages --- .../CheckingSyntacticTypes/E_Regression02.fs | 186 ++++++++---------- 1 file changed, 79 insertions(+), 107 deletions(-) diff --git a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs index ebefa1eecf1..deb1f392352 100644 --- a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs +++ b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/CheckingSyntacticTypes/E_Regression02.fs @@ -1,134 +1,106 @@ // #Regression #Conformance #TypeConstraints // Regression test for CTP bug reported at http://cs.hubfs.net/forums/thread/9313.aspx // In CTP, this was a stack overflow in the compiler. Now we give 64 errors -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P1' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P2' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined +//The value or constructor 'P2' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined +//The value or constructor 'P2' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined +//The value or constructor 'P2' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined +//The value or constructor 'P2' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined +//The value or constructor 'P3' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined +//The value or constructor 'P3' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined +//The value or constructor 'P3' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined +//The value or constructor 'P3' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined +//The value or constructor 'P3' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined +//The value or constructor 'P3' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined +//The value or constructor 'P3' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined +//The value or constructor 'P3' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined +//The value or constructor 'P3' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P1' is not defined +//The value or constructor 'P3' is not defined +//The type 'uint32' does not match the type 'int32' +//The value or constructor 'P3' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined +//The value or constructor 'P3' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined +//The value or constructor 'P3' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined +//The value or constructor 'P3' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined +//The value or constructor 'P3' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined +//The value or constructor 'P3' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined +//The value or constructor 'P4' is not defined //The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P2' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P3' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P4' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P4' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P4' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P4' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P4' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P4' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P4' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P4' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P4' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P4' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P4' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P4' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P4' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P4' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P4' is not defined -//The type 'uint32' does not match the type 'int32' -//The value or constructor 'P4' is not defined +//The value or constructor 'P4' is not defined module SmartHashUtils = let ByteToUInt (array:byte[]) offset length endian =