diff --git a/docs/release-notes/.FSharp.Compiler.Service/11.0.0.md b/docs/release-notes/.FSharp.Compiler.Service/11.0.0.md index 655ad02ad2a..75ee3d3d55c 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/11.0.0.md +++ b/docs/release-notes/.FSharp.Compiler.Service/11.0.0.md @@ -9,6 +9,8 @@ ### Added +* Type checker: recover on adding constraints ([#19034](https://github.com/dotnet/fsharp/pull/19034)) + ### Changed * Parallel compilation stabilised and enabled by default ([PR #18998](https://github.com/dotnet/fsharp/pull/18998)) diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index a8389e6ad05..0c0f68f7b0a 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -3939,7 +3939,7 @@ let AddCxTypeEqualsType contextInfo denv css m expected actual = PostponeOnFailedMemberConstraintResolution csenv NoTrace (fun csenv -> SolveTypeEqualsTypeWithReport csenv 0 m NoTrace None expected actual) ErrorD - |> RaiseOperationResult + |> ReportOperationResultAndRecover let UndoIfFailed f = let trace = Trace.New() @@ -4005,7 +4005,7 @@ let AddCxTypeMustSubsumeTypeMatchingOnlyUndoIfFailed denv css m extraRigidTypars let AddCxTypeMustSubsumeType contextInfo denv css m trace ty1 ty2 = let csenv = MakeConstraintSolverEnv contextInfo css m denv SolveTypeSubsumesTypeWithReport csenv 0 m trace None None ty1 ty2 - |> RaiseOperationResult + |> ReportOperationResultAndRecover let AddCxMethodConstraint denv css m trace traitInfo = let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv @@ -4017,25 +4017,25 @@ let AddCxMethodConstraint denv css m trace traitInfo = |> OperationResult.ignore }) (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) - |> RaiseOperationResult + |> ReportOperationResultAndRecover let AddCxTypeDefnNotSupportsNull denv css m trace ty = let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv PostponeOnFailedMemberConstraintResolution csenv trace (fun csenv -> SolveTypeUseNotSupportsNull csenv 0 m trace ty) (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) - |> RaiseOperationResult + |> ReportOperationResultAndRecover let AddCxTypeUseSupportsNull denv css m trace ty = let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv PostponeOnFailedMemberConstraintResolution csenv trace (fun csenv -> SolveTypeUseSupportsNull csenv 0 m trace ty) (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) - |> RaiseOperationResult + |> ReportOperationResultAndRecover let AddCxTypeCanCarryNullnessInfo denv css m ty nullness = let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv - let canCarryNullnessCheck() = SolveTypeCanCarryNullness csenv ty nullness |> RaiseOperationResult + let canCarryNullnessCheck() = SolveTypeCanCarryNullness csenv ty nullness |> ReportOperationResultAndRecover csenv.SolverState.PushPostInferenceCheck (preDefaults=false, check = canCarryNullnessCheck) @@ -4044,63 +4044,63 @@ let AddCxTypeMustSupportComparison denv css m trace ty = PostponeOnFailedMemberConstraintResolution csenv trace (fun csenv -> SolveTypeSupportsComparison csenv 0 m trace ty) (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) - |> RaiseOperationResult + |> ReportOperationResultAndRecover let AddCxTypeMustSupportEquality denv css m trace ty = let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv PostponeOnFailedMemberConstraintResolution csenv trace (fun csenv -> SolveTypeSupportsEquality csenv 0 m trace ty) (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) - |> RaiseOperationResult + |> ReportOperationResultAndRecover let AddCxTypeMustSupportDefaultCtor denv css m trace ty = let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv PostponeOnFailedMemberConstraintResolution csenv trace (fun csenv -> SolveTypeRequiresDefaultConstructor csenv 0 m trace ty) (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) - |> RaiseOperationResult + |> ReportOperationResultAndRecover let AddCxTypeIsReferenceType denv css m trace ty = let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv PostponeOnFailedMemberConstraintResolution csenv trace (fun csenv -> SolveTypeIsReferenceType csenv 0 m trace ty) (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) - |> RaiseOperationResult + |> ReportOperationResultAndRecover let AddCxTypeIsValueType denv css m trace ty = let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv PostponeOnFailedMemberConstraintResolution csenv trace (fun csenv -> SolveTypeIsNonNullableValueType csenv 0 m trace ty) (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) - |> RaiseOperationResult + |> ReportOperationResultAndRecover let AddCxTypeIsUnmanaged denv css m trace ty = let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv PostponeOnFailedMemberConstraintResolution csenv trace (fun csenv -> SolveTypeIsUnmanaged csenv 0 m trace ty) (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) - |> RaiseOperationResult + |> ReportOperationResultAndRecover let AddCxTypeIsEnum denv css m trace ty underlying = let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv PostponeOnFailedMemberConstraintResolution csenv trace (fun csenv -> SolveTypeIsEnum csenv 0 m trace ty underlying) (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) - |> RaiseOperationResult + |> ReportOperationResultAndRecover let AddCxTypeIsDelegate denv css m trace ty aty bty = let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv PostponeOnFailedMemberConstraintResolution csenv trace (fun csenv -> SolveTypeIsDelegate csenv 0 m trace ty aty bty) (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) - |> RaiseOperationResult + |> ReportOperationResultAndRecover let AddCxTyparDefaultsTo denv css m ctxtInfo tp ridx ty = let csenv = MakeConstraintSolverEnv ctxtInfo css m denv PostponeOnFailedMemberConstraintResolution csenv NoTrace (fun csenv -> AddConstraint csenv 0 m NoTrace tp (TyparConstraint.DefaultsTo(ridx, ty, m))) (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) - |> RaiseOperationResult + |> ReportOperationResultAndRecover let SolveTypeAsError denv css m ty = let ty2 = NewErrorType () @@ -4204,14 +4204,14 @@ let CheckDeclaredTypars denv css m typars1 typars2 = ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult -let CanonicalizePartialInferenceProblem css denv m tps = +let CanonicalizePartialInferenceProblem (css: ConstraintSolverState) (denv: DisplayEnv) (m: range) (tps: Typar list) : unit = // Canonicalize constraints prior to generalization let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv let csenv = { csenv with ErrorOnFailedMemberConstraintResolution = true } IgnoreFailedMemberConstraintResolution (fun () -> CanonicalizeRelevantMemberConstraints csenv 0 NoTrace tps) (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) - |> RaiseOperationResult + |> ReportOperationResultAndRecover /// An approximation used during name resolution for intellisense to eliminate extension members which will not /// apply to a particular object argument. This is given as the isApplicableMeth argument to the partial name resolution diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fs b/src/Compiler/Facilities/DiagnosticsLogger.fs index b3d08d6d1a3..723805ac09a 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fs +++ b/src/Compiler/Facilities/DiagnosticsLogger.fs @@ -665,6 +665,13 @@ let CommitOperationResult res = let RaiseOperationResult res : unit = CommitOperationResult res +let ReportOperationResultAndRecover (res: OperationResult) : unit = + match res with + | OkResult(warns, _) -> ReportWarnings warns + | ErrorResult(warns, err) -> + ReportWarnings warns + errorR err + let inline ErrorD err = ErrorResult([], err) let inline WarnD err = OkResult([ err ], ()) diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fsi b/src/Compiler/Facilities/DiagnosticsLogger.fsi index 7a083efae7e..aefd12ec77f 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fsi +++ b/src/Compiler/Facilities/DiagnosticsLogger.fsi @@ -351,6 +351,8 @@ type ImperativeOperationResult = OperationResult val ReportWarnings: warns: #exn list -> unit +val ReportOperationResultAndRecover: res: OperationResult -> unit + val CommitOperationResult: res: OperationResult<'T> -> 'T val RaiseOperationResult: res: OperationResult -> unit diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 6ad9c1fe727..d20a734f5fc 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -5715,8 +5715,8 @@ let InferValReprInfoOfExpr g allowTypeDirectedDetupling ty partialArgAttribsL re let fun_arity = vsl.Length let dtys, _ = stripFunTyN g fun_arity (snd (tryDestForallTy g ty)) let partialArgAttribsL = Array.ofList partialArgAttribsL - assert (List.length vsl = List.length dtys) - + if List.length vsl <> List.length dtys then ValReprInfo.emptyValData else + let curriedArgInfos = (vsl, dtys) ||> List.mapi2 (fun i vs ty -> let partialAttribs = if i < partialArgAttribsL.Length then partialArgAttribsL[i] else [] diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/MethodsAndProperties.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/MethodsAndProperties.fs index 6f5331abcbb..0a408a79acc 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/MethodsAndProperties.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/MethodsAndProperties/MethodsAndProperties.fs @@ -121,7 +121,9 @@ module MemberDefinitions_MethodsAndProperties = (Error 1, Line 11, Col 24, Line 11, Col 33, "This expression was expected to have type\n ''a array2d' \nbut here has type\n 'int array' ") (Error 1, Line 12, Col 25, Line 12, Col 32, "This expression was expected to have type\n ''a array' \nbut here has type\n 'int array2d' ") (Error 1, Line 13, Col 26, Line 13, Col 37, "This expression was expected to have type\n ''a array' \nbut here has type\n 'int array3d' ") + (Error 1, Line 13, Col 32, Line 13, Col 35, "This expression was expected to have type\n 'int' \nbut here has type\n 'int * int' ") (Error 1, Line 14, Col 27, Line 14, Col 38, "This expression was expected to have type\n ''a array' \nbut here has type\n 'int array4d' ") + (Error 1, Line 14, Col 33, Line 14, Col 36, "This expression was expected to have type\n 'int' \nbut here has type\n 'int * int' ") ] // SOURCE=E_IndexerArityMismatch02.fs SCFLAGS="--test:ErrorRanges --flaterrors" # E_IndexerArityMismatch02.fs diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/TypeAbbreviations/TypeAbbreviations.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/TypeAbbreviations/TypeAbbreviations.fs index 365f1af46b7..76b6c42bb5c 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/TypeAbbreviations/TypeAbbreviations.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/TypeAbbreviations/TypeAbbreviations.fs @@ -85,7 +85,6 @@ module TypeAbbreviations = |> shouldFail |> withDiagnostics [ (Error 1, Line 16, Col 14, Line 16, Col 19, "A type parameter is missing a constraint 'when 'b :> IB'") - (Error 35, Line 16, Col 6, Line 16, Col 7, "This construct is deprecated: This type abbreviation has one or more declared type parameters that do not appear in the type being abbreviated. Type abbreviations must use all declared type parameters in the type being abbreviated. Consider removing one or more type parameters, or use a concrete type definition that wraps an underlying type, such as 'type C<'a> = C of ...'.") ] //SOURCE=E_DroppedTypeVariable01.fsx SCFLAGS="--test:ErrorRanges -a" # E_DroppedTypeVariable01.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Constraints/Unmanaged.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Constraints/Unmanaged.fs index 173f18537a5..ca326e1b3a0 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Constraints/Unmanaged.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Constraints/Unmanaged.fs @@ -69,7 +69,9 @@ let _ = Test>>() |> shouldFail |> withDiagnostics [ Error 1, Line 10, Col 9, Line 10, Col 33, "A generic construct requires that the type 'DoubleType' is an unmanaged type" - Error 1, Line 11, Col 9, Line 11, Col 49, "A generic construct requires that the type 'DoubleType>' is an unmanaged type" ] + Error 1, Line 11, Col 9, Line 11, Col 49, "A generic construct requires that the type 'DoubleType>' is an unmanaged type" + Error 688, Line 11, Col 9, Line 11, Col 51, "The default, zero-initializing constructor of a struct type may only be used if all the fields of the struct type admit default initialization" + ] [] let ``voption considered unmanaged when inner type is unmanaged`` () = @@ -348,7 +350,9 @@ let _ = Test>>() Error 193, Line 26, Col 24, Line 26, Col 36, "A generic construct requires that the type 'A<'T,obj>' is an unmanaged type" Error 1, Line 27, Col 9, Line 27, Col 18, "A generic construct requires that the type 'obj' is an unmanaged type" Error 1, Line 28, Col 9, Line 28, Col 28, "A generic construct requires that the type 'NonStructRecd' is an unmanaged type" - Error 1, Line 29, Col 9, Line 29, Col 49, "A generic construct requires that the type 'string' is an unmanaged type" ] + Error 688, Line 28, Col 9, Line 28, Col 30, "The default, zero-initializing constructor of a struct type may only be used if all the fields of the struct type admit default initialization" + Error 1, Line 29, Col 9, Line 29, Col 49, "A generic construct requires that the type 'string' is an unmanaged type" + ] [] let ``Disallow both 'unmanaged' and 'not struct' constraints`` () = diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ObjectExpressions/ObjectExpressions.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ObjectExpressions/ObjectExpressions.fs index 7838300082a..21fa53f3f58 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ObjectExpressions/ObjectExpressions.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ObjectExpressions/ObjectExpressions.fs @@ -520,7 +520,7 @@ but here has type 'AsString' but here has type 'SomeDu' " - Warning 25, Line 30, Col 19, Line 30, Col 23, "Incomplete pattern matches on this expression."] + ] [] let ``Object expression implementing multiple interfaces`` () = diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/ConsList/ConsList.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/ConsList/ConsList.fs index 6292d3b78fa..cb076a0791d 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/ConsList/ConsList.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/PatternMatching/ConsList/ConsList.fs @@ -46,10 +46,13 @@ but here has type |> withOptions ["--test:ErrorRanges"] |> typecheck |> shouldFail - |> withSingleDiagnostic (Error 1, Line 15, Col 22, Line 15, Col 24, "This expression was expected to have type - 'int' -but here has type - ''a list' ") + |> withDiagnostics [ + (Error 1, Line 15, Col 22, Line 15, Col 24, "This expression was expected to have type\n 'int' \nbut here has type\n ''a list' ") + (Error 1, Line 16, Col 14, Line 16, Col 16, "This expression was expected to have type\n 'int' \nbut here has type\n ''a list' ") + (Warning 25, Line 13, Col 11, Line 13, Col 12, "Incomplete pattern matches on this expression. For example, the value '[_]' may indicate a case not covered by the pattern(s).") + (Warning 26, Line 15, Col 7, Line 15, Col 18, "This rule will never be matched") + (Warning 26, Line 16, Col 7, Line 16, Col 24, "This rule will never be matched") + ] // This test was automatically generated (moved from FSharpQA suite - Conformance/PatternMatching/ConsList) [] diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs index 69c14a8d418..7995f99b17c 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs @@ -238,6 +238,7 @@ let x() = ({| b = 2; c = 3 |} = {| a = 2; d = "" |} ) |> shouldFail |> withDiagnostics [ (Error 1, Line 2, Col 33, Line 2, Col 52, "This anonymous record should have fields 'b', 'c'; but here has fields 'a', 'd'.") + (Error 1, Line 2, Col 47, Line 2, Col 49, "This expression was expected to have type\n 'int' \nbut here has type\n 'string' ") ] [] diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/RecordTypes.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/RecordTypes.fs index da18bda2f33..79189aa20d9 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/RecordTypes.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/RecordTypes.fs @@ -130,6 +130,9 @@ module RecordTypes = |> shouldFail |> withDiagnostics [ (Error 1, Line 7, Col 17, Line 7, Col 47, "This expression was expected to have type\n 'int array' \nbut here has type\n 'RecType' ") + (Error 786, Line 7, Col 17, Line 7, Col 47, "The expression form { expr with ... } may only be used with record types. To build object types use { new Type(...) with ... }"); + (Error 791, Line 7, Col 17, Line 7, Col 47, "This type is not a record type"); + (Error 763, Line 7, Col 17, Line 7, Col 47, "The field 'B' has been given a value, but is not present in the type 'int array'") ] // SOURCE=E_RecordsNotNull01.fs # E_RecordsNotNull01.fs diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ConstructorTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ConstructorTests.fs index ffaf232ae13..d371403025a 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ConstructorTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ConstructorTests.fs @@ -31,6 +31,8 @@ let x = { Name = "Isaac", Age = 21, City = "London" } |> shouldFail |> withDiagnostics [ (Error 1, Line 3, Col 18, Line 3, Col 52, "This expression was expected to have type\n 'string' \nbut here has type\n ''a * 'b * 'c' " + System.Environment.NewLine + "A ';' is used to separate field values in records. Consider replacing ',' with ';'.") + (Error 39, Line 3, Col 27, Line 3, Col 30, "The value or constructor 'Age' is not defined.") + (Error 39, Line 3, Col 37, Line 3, Col 41, "The value or constructor 'City' is not defined.") (Error 764, Line 3, Col 9, Line 3, Col 54, "No assignment given for field 'Age' of type 'Test.Person'")] [] diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ElseBranchHasWrongTypeTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ElseBranchHasWrongTypeTests.fs index 22d4a77745c..37ec82f49a5 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ElseBranchHasWrongTypeTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ElseBranchHasWrongTypeTests.fs @@ -119,8 +119,10 @@ let y = """ |> typecheck |> shouldFail - |> withSingleDiagnostic (Error 1, Line 7, Col 14, Line 7, Col 22, - "This expression was expected to have type\n 'int' \nbut here has type\n 'string' ") + |> withDiagnostics [ + (Error 1, Line 7, Col 14, Line 7, Col 22, "This expression was expected to have type\n 'int' \nbut here has type\n 'string' ") + (Error 1, Line 8, Col 26, Line 8, Col 27, "This expression was expected to have type\n 'string' \nbut here has type\n 'int' ") + ] [] let ``Else branch context doesn't propagate to lines before last line``() = diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs index d645f4d5a92..0ed6b0cb9c7 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TypeMismatchTests.fs @@ -292,7 +292,10 @@ type Derived3() = |> withDiagnostics [ (Error 856, Line 8, Col 16, Line 8, Col 22, "This override takes a different number of arguments to the corresponding abstract member. The following abstract members were found:" + System.Environment.NewLine + " abstract Base.Member: int * string -> string") (Error 856, Line 12, Col 16, Line 12, Col 22, "This override takes a different number of arguments to the corresponding abstract member. The following abstract members were found:" + System.Environment.NewLine + " abstract Base.Member: int * string -> string") - (Error 1, Line 16, Col 24, Line 16, Col 34, "This expression was expected to have type\n 'int' \nbut here has type\n 'string' ")] + (Error 1, Line 16, Col 24, Line 16, Col 34, "This expression was expected to have type\n 'int' \nbut here has type\n 'string' ") + (Error 1, Line 16, Col 36, Line 16, Col 43, "This expression was expected to have type\n 'string' \nbut here has type\n 'int' "); + (Error 1, Line 16, Col 66, Line 16, Col 67, "This expression was expected to have type\n 'string' \nbut here has type\n 'int' ") + ] [] let ``Interface member with tuple argument should give error message with better solution``() = diff --git a/tests/FSharp.Compiler.ComponentTests/Language/FixedBindings/FixedBindings.fs b/tests/FSharp.Compiler.ComponentTests/Language/FixedBindings/FixedBindings.fs index fbf2f609529..d0f369ae622 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/FixedBindings/FixedBindings.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/FixedBindings/FixedBindings.fs @@ -47,6 +47,7 @@ module Legacy = but given a 'nativeptr' The type 'int' does not match the type 'byte'""") + (Warning 9, Line 6, Col 5, Line 6, Col 18, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") ] [] @@ -64,6 +65,7 @@ The type 'int' does not match the type 'byte'""") but given a 'nativeptr' The type 'char' does not match the type 'byte'""") + (Warning 9, Line 6, Col 5, Line 6, Col 18, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") ] [] @@ -437,6 +439,7 @@ The type 'char' does not match the type 'byte'""") but given a 'nativeptr' The type 'int' does not match the type 'char'") + (Warning 9, Line 10, Col 5, Line 10, Col 18, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") ] [] @@ -667,6 +670,7 @@ module ExtendedFixedBindings = but given a 'nativeptr' The type 'int' does not match the type 'char'") + (Warning 9, Line 10, Col 5, Line 10, Col 18, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""") ] [] diff --git a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs index de591b580a9..663a4d09b46 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs @@ -1031,7 +1031,7 @@ let test = |> shouldFail |> withDiagnostics [Error 1, Line 5, Col 7, Line 5, Col 9, "The type 'int' does not have 'null' as a proper value. See also test.fs(3,10)-(3,14)." - Error 25, Line 3, Col 11, Line 3, Col 15, "Incomplete pattern matches on this expression."] + Error 25, Line 3, Col 11, Line 3, Col 15, "Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s)."] [] diff --git a/tests/FSharp.Compiler.Service.Tests/Common.fs b/tests/FSharp.Compiler.Service.Tests/Common.fs index 5a46438a96e..9779b4256fd 100644 --- a/tests/FSharp.Compiler.Service.Tests/Common.fs +++ b/tests/FSharp.Compiler.Service.Tests/Common.fs @@ -442,14 +442,16 @@ let assertContainsSymbolsWithNames (names: string list) source = |> Seq.contains name |> shouldEqual true -let assertHasSymbolUsages (names: string list) (results: FSharpCheckFileResults) = +let assertHasSymbolUsages (expectedNames: string list) (results: FSharpCheckFileResults) = + let symbols = + getSymbolUses results |> getSymbols |> List.ofSeq + let symbolNames = - getSymbolUses results - |> getSymbols + symbols |> Seq.choose getSymbolName |> set - for name in names do + for name in expectedNames do Assert.True(Set.contains name symbolNames, name) let findSymbolUseByName (name: string) (results: FSharpCheckFileResults) = diff --git a/tests/FSharp.Compiler.Service.Tests/PatternMatchCompilationTests.fs b/tests/FSharp.Compiler.Service.Tests/PatternMatchCompilationTests.fs index f4da930e4d2..3a515d765c1 100644 --- a/tests/FSharp.Compiler.Service.Tests/PatternMatchCompilationTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/PatternMatchCompilationTests.fs @@ -28,7 +28,7 @@ let ("": unit), (x: int) = let y = () in () dumpDiagnostics checkResults |> shouldEqual [ "(2,5--2,7): This expression was expected to have type 'unit' but here has type 'string'"; "(2,41--2,43): This expression was expected to have type 'unit * int' but here has type 'unit'"; - "(2,4--2,24): Incomplete pattern matches on this expression." + """(2,4--2,24): Incomplete pattern matches on this expression. For example, the value '("a",_)' may indicate a case not covered by the pattern(s).""" ] [] @@ -83,7 +83,7 @@ match A with assertHasSymbolUsages ["x"; "y"] checkResults dumpDiagnostics checkResults |> shouldEqual [ "(7,5--7,12): This expression was expected to have type 'int' but here has type ''a * 'b * 'c'"; - "(6,6--6,7): Incomplete pattern matches on this expression." + "(6,6--6,7): Incomplete pattern matches on this expression. For example, the value 'A' may indicate a case not covered by the pattern(s)." ] @@ -171,7 +171,7 @@ match Some 1 with assertHasSymbolUsages ["a"] checkResults dumpDiagnostics checkResults |> shouldEqual [ "(3,7--3,14): This expression was expected to have type 'int' but here has type ''a option'" - "(2,6--2,12): Incomplete pattern matches on this expression." + """(2,6--2,12): Incomplete pattern matches on this expression. For example, the value 'Some (Some ("a"))' may indicate a case not covered by the pattern(s).""" ] [] @@ -183,7 +183,7 @@ match Some 1 with assertHasSymbolUsages ["a"; "i"] checkResults dumpDiagnostics checkResults |> shouldEqual [ "(3,7--3,18): This expression was expected to have type 'int' but here has type ''a option'"; - "(2,6--2,12): Incomplete pattern matches on this expression." + """(2,6--2,12): Incomplete pattern matches on this expression. For example, the value 'Some (Some (("a",_)))' may indicate a case not covered by the pattern(s).""" ] [] @@ -337,6 +337,8 @@ match Unchecked.defaultof with assertHasSymbolUsages ["a"; "b"; "c"; "d"] checkResults dumpDiagnostics checkResults |> shouldEqual [ "(5,21--5,27): Type constraint mismatch. The type 'int' is not compatible with type 'System.Enum'" + "(6,2--6,11): Type constraint mismatch. The type 'string' is not compatible with type 'System.ValueType'" + "(4,2--4,46): This rule will never be matched" ] [] @@ -958,6 +960,8 @@ Some "" |> eq // No more type checks after the above line? dumpDiagnostics checkResults |> shouldEqual [ "(27,2--27,14): This expression was expected to have type 'objnull' but here has type 'struct ('a * 'b)'"; "(52,2--52,13): This expression was expected to have type 'objnull' but here has type 'AAA'"; + "(53,11--53,18): Type mismatch. Expecting a 'string option -> 'a' but given a 'int option -> unit' The type 'int' does not match the type 'string'" + "(51,6--51,21): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; "(26,6--26,24): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; "(24,6--24,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; "(22,6--22,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; diff --git a/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs b/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs index c4261eaeab3..5a37593c715 100644 --- a/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs @@ -3060,7 +3060,7 @@ let ``Test Project21 whole project errors`` () = let wholeProjectResults = checker.ParseAndCheckProject(Project21.options) |> Async.RunImmediate for e in wholeProjectResults.Diagnostics do printfn "Project21 error: <<<%s>>>" e.Message - wholeProjectResults.Diagnostics.Length |> shouldEqual 2 + wholeProjectResults.Diagnostics.Length |> shouldEqual 1 [] @@ -3090,6 +3090,11 @@ let ``Test Project21 all symbols`` () = ("int", "int", "file1", ((8, 27), (8, 30)), ["type"], ["abbrev"]); ("val x", "x", "file1", ((9, 21), (9, 22)), ["defn"], []); ("string", "string", "file1", ((9, 37), (9, 43)), ["type"], ["abbrev"]); + ("val arg1", "arg1", "file1", ((9, 31), (9, 35)), ["defn"], []); + ("unit", "unit", "file1", ((9, 46), (9, 50)), ["type"], ["abbrev"]); + ("val raise", "raise", "file1", ((10, 18), (10, 23)), [], ["val"]); + ("System", "System", "file1", ((10, 25), (10, 31)), [], ["namespace"]); + ("member .ctor", "NotImplementedException", "file1", ((10, 25), (10, 55)), [], ["member"]); ("val x", "x", "file1", ((12, 21), (12, 22)), ["defn"], []); ("int", "int", "file1", ((12, 37), (12, 40)), ["type"], ["abbrev"]); ("val arg1", "arg1", "file1", ((12, 31), (12, 35)), ["defn"], []); @@ -3097,6 +3102,8 @@ let ``Test Project21 all symbols`` () = ("val raise", "raise", "file1", ((13, 18), (13, 23)), [], ["val"]); ("System", "System", "file1", ((13, 25), (13, 31)), [], ["namespace"]); ("member .ctor", "NotImplementedException", "file1", ((13, 25), (13, 55)), [], ["member"]); + ("member Method1", "Method1", "file1", ((9, 23), (9, 30)), ["override"], ["slot"; "member"]); + ("member Method2", "Method2", "file1", ((12, 23), (12, 30)), ["override"], ["slot"; "member"]) ("Impl", "Impl", "file1", ((2, 7), (2, 11)), ["defn"], ["module"])|] //----------------------------------------------------------------------------------------- diff --git a/tests/FSharp.Compiler.Service.Tests/TypeChecker/TypeCheckerRecoveryTests.fs b/tests/FSharp.Compiler.Service.Tests/TypeChecker/TypeCheckerRecoveryTests.fs index 07827b7d399..65f67b40ee2 100644 --- a/tests/FSharp.Compiler.Service.Tests/TypeChecker/TypeCheckerRecoveryTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/TypeChecker/TypeCheckerRecoveryTests.fs @@ -49,4 +49,83 @@ Math.Max(a,b,) "(4,0--4,14)", 503 ] - assertHasSymbolUsages ["Max"] checkResults \ No newline at end of file + assertHasSymbolUsages ["Max"] checkResults + +module Constraints = + [] + let ``Type 01`` () = + let _, checkResults = getParseAndCheckResults """ +let f (x: unit) = + x + 1 + +f () +""" + assertHasSymbolUsages ["f"; "x"] checkResults + + [] + let ``Reference 01`` () = + let _, checkResults = getParseAndCheckResults """ +let f<'T when 'T : not struct> (x: 'T) = + x + +let (i: int) = f 1 +""" + assertHasSymbolUsages ["f"; "x"; "i"] checkResults + + [] + let ``Struct 01`` () = + let _, checkResults = getParseAndCheckResults """ +let f<'T when 'T : struct> (x: 'T) = + x + +let i = f 1 +""" + assertHasSymbolUsages ["f"; "x"; "i"] checkResults + + [] + let ``Struct 02`` () = + let _, checkResults = getParseAndCheckResults """ +let f<'T when 'T : struct> (x: 'T) = + x + +let i = f Unchecked.defaultof +""" + assertHasSymbolUsages ["f"; "x"; "defaultof"; "i"] checkResults + + [] + let ``Struct 03`` () = + let _, checkResults = getParseAndCheckResults """ +let f<'T when 'T : struct> (x: 'T) = + x + +let i = f Unchecked.defaultof +""" + assertHasSymbolUsages ["f"; "x"; "defaultof"; "i"] checkResults + + [] + let ``Equality 01`` () = + let _, checkResults = getParseAndCheckResults """ +let f<'T when 'T : equality> (x: 'T) = + x + +[] +type T() = + class end + +let i = f Unchecked.defaultof +""" + assertHasSymbolUsages ["f"; "x"; "defaultof"; "i"] checkResults + + [] + let ``Equality 02`` () = + let _, checkResults = getParseAndCheckResults """ +let f<'T when 'T : equality> (x: 'T) = + x + +[] +type T() = + class end + +let i = f Unchecked.defaultof +""" + assertHasSymbolUsages ["f"; "x"; "defaultof"; "i"] checkResults diff --git a/tests/fsharp/Compiler/Language/AnonRecordTests.fs b/tests/fsharp/Compiler/Language/AnonRecordTests.fs index 57f50937fc1..174724197d8 100644 --- a/tests/fsharp/Compiler/Language/AnonRecordTests.fs +++ b/tests/fsharp/Compiler/Language/AnonRecordTests.fs @@ -27,24 +27,18 @@ let sAnon = StructClass() [] let NotStructConstraintFail() = - CompilerAssert.TypeCheckSingleError - """ + CompilerAssert.TypeCheckWithErrors """ type RefClass<'a when 'a : not struct>() = class end let rAnon = RefClass() - """ - FSharpDiagnosticSeverity.Error - 1 - (3, 13, 3, 42) - "A generic construct requires that the type 'struct {| R: int |}' have reference semantics, but it does not, i.e. it is a struct" +""" + [| FSharpDiagnosticSeverity.Error, 1, (3, 13, 3, 42), "A generic construct requires that the type 'struct {| R: int |}' have reference semantics, but it does not, i.e. it is a struct" + FSharpDiagnosticSeverity.Error, 1, (3, 13, 3, 44), "A generic construct requires that the type 'struct {| R: int |}' have reference semantics, but it does not, i.e. it is a struct" |] [] let StructConstraintFail() = - CompilerAssert.TypeCheckSingleError - """ + CompilerAssert.TypeCheckWithErrors """ type StructClass<'a when 'a : struct>() = class end let sAnon = StructClass<{| S: int |}>() - """ - FSharpDiagnosticSeverity.Error - 1 - (3, 13, 3, 38) - "A generic construct requires that the type '{| S: int |}' is a CLI or F# struct type" +""" + [| FSharpDiagnosticSeverity.Error, 1, (3, 13, 3, 38), "A generic construct requires that the type '{| S: int |}' is a CLI or F# struct type" + FSharpDiagnosticSeverity.Error, 1, (3, 13, 3, 40), "A generic construct requires that the type '{| S: int |}' is a CLI or F# struct type" |] diff --git a/tests/fsharp/core/auto-widen/5.0/test.bsl b/tests/fsharp/core/auto-widen/5.0/test.bsl index 0d5f9537c56..d57a1e4e9a2 100644 --- a/tests/fsharp/core/auto-widen/5.0/test.bsl +++ b/tests/fsharp/core/auto-widen/5.0/test.bsl @@ -134,6 +134,11 @@ but here has type test.fsx(64,50,64,71): typecheck error FS0001: All elements of a list must be implicitly convertible to the type of the first element, which here is 'int64'. This element has type 'int'. +test.fsx(67,20,67,23): typecheck error FS0001: This expression was expected to have type + 'obj' +but here has type + 'int' + test.fsx(67,20,67,23): typecheck error FS0001: This expression was expected to have type 'obj' but here has type @@ -144,6 +149,16 @@ test.fsx(68,22,68,25): typecheck error FS0001: This expression was expected to h but here has type 'int' +test.fsx(68,22,68,25): typecheck error FS0001: This expression was expected to have type + 'int64' +but here has type + 'int' + +test.fsx(69,26,69,29): typecheck error FS0001: This expression was expected to have type + 'int64' +but here has type + 'int' + test.fsx(69,26,69,29): typecheck error FS0001: This expression was expected to have type 'int64' but here has type @@ -334,21 +349,54 @@ test.fsx(207,20,207,35): typecheck error FS0001: This expression was expected to but here has type 'R' +test.fsx(207,20,207,35): typecheck error FS0791: This type is not a record type + +test.fsx(207,20,207,35): typecheck error FS0763: The field 'F1' has been given a value, but is not present in the type 'obj' + test.fsx(210,22,210,41): typecheck error FS0001: This expression was expected to have type 'obj' but here has type 'R' +test.fsx(210,30,210,31): typecheck error FS0001: This expression was expected to have type + 'obj' +but here has type + 'int' + +test.fsx(210,33,210,34): typecheck error FS0001: This expression was expected to have type + 'obj' +but here has type + 'int' + test.fsx(213,20,213,36): typecheck error FS0001: This expression was expected to have type 'obj' but here has type 'SR' +test.fsx(213,20,213,36): typecheck error FS0791: This type is not a record type + +test.fsx(213,20,213,36): typecheck error FS0763: The field 'SF1' has been given a value, but is not present in the type 'obj' + test.fsx(216,22,216,43): typecheck error FS0001: This expression was expected to have type 'obj' but here has type 'SR' +test.fsx(216,31,216,32): typecheck error FS0001: This expression was expected to have type + 'obj' +but here has type + 'int' + +test.fsx(216,34,216,35): typecheck error FS0001: This expression was expected to have type + 'obj' +but here has type + 'int' + +test.fsx(219,20,219,33): typecheck error FS0001: This expression was expected to have type + 'obj' +but here has type + 'U' + test.fsx(219,20,219,33): typecheck error FS0001: This expression was expected to have type 'obj' but here has type @@ -369,6 +417,11 @@ test.fsx(228,21,228,40): typecheck error FS0001: This expression was expected to but here has type 'SU' +test.fsx(228,21,228,40): typecheck error FS0001: This expression was expected to have type + 'obj' +but here has type + 'SU' + test.fsx(231,21,231,37): typecheck error FS0001: This expression was expected to have type 'obj' but here has type @@ -533,6 +586,11 @@ test.fsx(286,22,286,45): typecheck error FS0001: This expression was expected to but here has type 'IComparable' +test.fsx(286,22,286,24): typecheck error FS0001: This expression was expected to have type + 'IComparable' +but here has type + 'string' + test.fsx(287,22,287,24): typecheck error FS0001: This expression was expected to have type 'obj' but here has type @@ -558,6 +616,11 @@ test.fsx(291,21,291,30): typecheck error FS0001: This expression was expected to but here has type 'string' +test.fsx(291,21,291,30): typecheck error FS0001: This expression was expected to have type + 'obj' +but here has type + 'string' + test.fsx(292,24,292,26): typecheck error FS0001: This expression was expected to have type 'obj' but here has type @@ -673,21 +736,41 @@ test.fsx(337,9,338,34): typecheck error FS0001: This expression was expected to but here has type ''a list' +test.fsx(338,30,338,32): typecheck error FS0001: This expression was expected to have type + 'int' +but here has type + 'int64' + test.fsx(340,9,341,33): typecheck error FS0001: This expression was expected to have type 'int64 seq' but here has type ''a list' +test.fsx(341,30,341,31): typecheck error FS0001: This expression was expected to have type + 'int64' +but here has type + 'int' + test.fsx(343,9,344,35): typecheck error FS0001: This expression was expected to have type 'int64 seq' but here has type ''a list' +test.fsx(344,32,344,33): typecheck error FS0001: This expression was expected to have type + 'int64' +but here has type + 'int' + test.fsx(346,9,347,36): typecheck error FS0001: This expression was expected to have type 'int64 seq' but here has type ''a list' +test.fsx(347,32,347,34): typecheck error FS0001: This expression was expected to have type + 'int' +but here has type + 'int64' + test.fsx(349,9,349,36): typecheck error FS0001: This expression was expected to have type 'int64 seq' but here has type @@ -703,11 +786,21 @@ test.fsx(353,9,354,40): typecheck error FS0001: This expression was expected to but here has type ''a list' +test.fsx(354,37,354,38): typecheck error FS0001: This expression was expected to have type + 'int64' +but here has type + 'int' + test.fsx(356,9,357,41): typecheck error FS0001: This expression was expected to have type 'int64 seq' but here has type ''a list' +test.fsx(357,37,357,39): typecheck error FS0001: This expression was expected to have type + 'int' +but here has type + 'int64' + test.fsx(359,9,359,35): typecheck error FS0001: This expression was expected to have type 'int64 seq' but here has type @@ -718,11 +811,21 @@ test.fsx(361,9,362,36): typecheck error FS0001: This expression was expected to but here has type ''a list' +test.fsx(362,21,362,22): typecheck error FS0001: This expression was expected to have type + 'int64' +but here has type + 'int' + test.fsx(364,9,365,37): typecheck error FS0001: This expression was expected to have type 'int64 seq' but here has type ''a list' +test.fsx(365,21,365,23): typecheck error FS0001: This expression was expected to have type + 'int' +but here has type + 'int64' + test.fsx(368,39,368,40): typecheck error FS0001: This expression was expected to have type 'int64' but here has type @@ -788,21 +891,41 @@ test.fsx(391,30,392,57): typecheck error FS0001: This expression was expected to but here has type ''a array' +test.fsx(392,52,392,54): typecheck error FS0001: This expression was expected to have type + 'int' +but here has type + 'int64' + test.fsx(393,30,394,56): typecheck error FS0001: This expression was expected to have type 'int64 seq' but here has type ''a array' +test.fsx(394,52,394,53): typecheck error FS0001: This expression was expected to have type + 'int64' +but here has type + 'int' + test.fsx(395,30,396,58): typecheck error FS0001: This expression was expected to have type 'int64 seq' but here has type ''a array' +test.fsx(396,54,396,55): typecheck error FS0001: This expression was expected to have type + 'int64' +but here has type + 'int' + test.fsx(397,30,398,59): typecheck error FS0001: This expression was expected to have type 'int64 seq' but here has type ''a array' +test.fsx(398,54,398,56): typecheck error FS0001: This expression was expected to have type + 'int' +but here has type + 'int64' + test.fsx(399,30,399,59): typecheck error FS0001: This expression was expected to have type 'int64 seq' but here has type @@ -818,11 +941,21 @@ test.fsx(401,30,402,63): typecheck error FS0001: This expression was expected to but here has type ''a array' +test.fsx(402,59,402,60): typecheck error FS0001: This expression was expected to have type + 'int64' +but here has type + 'int' + test.fsx(403,30,404,64): typecheck error FS0001: This expression was expected to have type 'int64 seq' but here has type ''a array' +test.fsx(404,59,404,61): typecheck error FS0001: This expression was expected to have type + 'int' +but here has type + 'int64' + test.fsx(405,31,405,59): typecheck error FS0001: This expression was expected to have type 'int64 seq' but here has type @@ -833,21 +966,35 @@ test.fsx(406,31,407,60): typecheck error FS0001: This expression was expected to but here has type ''a array' +test.fsx(407,44,407,45): typecheck error FS0001: This expression was expected to have type + 'int64' +but here has type + 'int' + test.fsx(408,31,409,61): typecheck error FS0001: This expression was expected to have type 'int64 seq' but here has type ''a array' +test.fsx(409,44,409,46): typecheck error FS0001: This expression was expected to have type + 'int' +but here has type + 'int64' + test.fsx(429,10,437,16): typecheck error FS0001: This expression was expected to have type 'int64 seq' but here has type 'OtherSeq<'a>' +test.fsx(432,19,432,58): typecheck error FS0501: The member or object constructor 'ToString' takes 0 argument(s) but is here given 1. The required signature is 'Object.ToString() : string'. + test.fsx(448,9,450,49): typecheck error FS0001: This expression was expected to have type 'int64 seq' but here has type 'OtherSeqImpl<'a>' +test.fsx(450,14,450,29): typecheck error FS0501: The member or object constructor 'ToString' takes 0 argument(s) but is here given 1. The required signature is 'Object.ToString() : string'. + test.fsx(452,32,452,33): typecheck error FS0001: This expression was expected to have type 'int64' but here has type diff --git a/tests/fsharp/typeProviders/negTests/neg1.bsl b/tests/fsharp/typeProviders/negTests/neg1.bsl index f4442e42b83..e1308bf5f12 100644 --- a/tests/fsharp/typeProviders/negTests/neg1.bsl +++ b/tests/fsharp/typeProviders/negTests/neg1.bsl @@ -480,66 +480,92 @@ neg1.fsx(56,109,56,111): typecheck error FS0001: This expression was expected to but here has type 'int64' +neg1.fsx(56,9,56,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(57,109,57,111): typecheck error FS0001: This expression was expected to have type 'int' but here has type 'int16' +neg1.fsx(57,9,57,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(58,109,58,111): typecheck error FS0001: This expression was expected to have type 'int' but here has type 'sbyte' +neg1.fsx(58,9,58,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(59,109,59,112): typecheck error FS0001: This expression was expected to have type 'int' but here has type 'uint64' +neg1.fsx(59,9,59,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(60,109,60,112): typecheck error FS0001: This expression was expected to have type 'int' but here has type 'byte' +neg1.fsx(60,9,60,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(61,109,61,111): typecheck error FS0001: This expression was expected to have type 'int' but here has type 'uint32' +neg1.fsx(61,9,61,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(62,109,62,112): typecheck error FS0001: This expression was expected to have type 'int' but here has type 'uint16' +neg1.fsx(62,9,62,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(63,109,63,113): typecheck error FS0001: This expression was expected to have type 'int' but here has type 'decimal' +neg1.fsx(63,9,63,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(64,109,64,112): typecheck error FS0001: This expression was expected to have type 'int' but here has type 'float' +neg1.fsx(64,9,64,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(65,109,65,113): typecheck error FS0001: This expression was expected to have type 'int' but here has type 'float32' +neg1.fsx(65,9,65,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(66,109,66,112): typecheck error FS0001: This expression was expected to have type 'int' but here has type 'string' +neg1.fsx(66,9,66,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(67,109,67,112): typecheck error FS0001: This expression was expected to have type 'int' but here has type 'char' +neg1.fsx(67,9,67,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(68,109,68,113): typecheck error FS0001: This expression was expected to have type 'int' but here has type 'bool' +neg1.fsx(68,9,68,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(72,103,72,105): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'sbyte'. neg1.fsx(73,103,73,104): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'sbyte'. @@ -569,66 +595,92 @@ neg1.fsx(86,109,86,111): typecheck error FS0001: This expression was expected to but here has type 'int64' +neg1.fsx(86,9,86,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(87,109,87,111): typecheck error FS0001: This expression was expected to have type 'sbyte' but here has type 'int16' +neg1.fsx(87,9,87,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(88,109,88,110): typecheck error FS0001: This expression was expected to have type 'sbyte' but here has type 'int' +neg1.fsx(88,9,88,111): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(89,109,89,112): typecheck error FS0001: This expression was expected to have type 'sbyte' but here has type 'uint64' +neg1.fsx(89,9,89,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(90,109,90,112): typecheck error FS0001: This expression was expected to have type 'sbyte' but here has type 'byte' +neg1.fsx(90,9,90,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(91,109,91,111): typecheck error FS0001: This expression was expected to have type 'sbyte' but here has type 'uint32' +neg1.fsx(91,9,91,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(92,109,92,112): typecheck error FS0001: This expression was expected to have type 'sbyte' but here has type 'uint16' +neg1.fsx(92,9,92,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(93,109,93,113): typecheck error FS0001: This expression was expected to have type 'sbyte' but here has type 'decimal' +neg1.fsx(93,9,93,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(94,109,94,112): typecheck error FS0001: This expression was expected to have type 'sbyte' but here has type 'float' +neg1.fsx(94,9,94,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(95,109,95,113): typecheck error FS0001: This expression was expected to have type 'sbyte' but here has type 'float32' +neg1.fsx(95,9,95,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(96,109,96,112): typecheck error FS0001: This expression was expected to have type 'sbyte' but here has type 'string' +neg1.fsx(96,9,96,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(97,109,97,112): typecheck error FS0001: This expression was expected to have type 'sbyte' but here has type 'char' +neg1.fsx(97,9,97,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(98,109,98,113): typecheck error FS0001: This expression was expected to have type 'sbyte' but here has type 'bool' +neg1.fsx(98,9,98,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(101,103,101,105): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'int16'. neg1.fsx(102,103,102,104): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'int16'. @@ -660,66 +712,92 @@ neg1.fsx(116,109,116,111): typecheck error FS0001: This expression was expected but here has type 'int64' +neg1.fsx(116,9,116,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(117,109,117,110): typecheck error FS0001: This expression was expected to have type 'int16' but here has type 'int' +neg1.fsx(117,9,117,111): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(118,109,118,111): typecheck error FS0001: This expression was expected to have type 'int16' but here has type 'sbyte' +neg1.fsx(118,9,118,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(119,109,119,112): typecheck error FS0001: This expression was expected to have type 'int16' but here has type 'uint64' +neg1.fsx(119,9,119,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(120,109,120,112): typecheck error FS0001: This expression was expected to have type 'int16' but here has type 'byte' +neg1.fsx(120,9,120,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(121,109,121,111): typecheck error FS0001: This expression was expected to have type 'int16' but here has type 'uint32' +neg1.fsx(121,9,121,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(122,109,122,112): typecheck error FS0001: This expression was expected to have type 'int16' but here has type 'uint16' +neg1.fsx(122,9,122,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(123,109,123,113): typecheck error FS0001: This expression was expected to have type 'int16' but here has type 'decimal' +neg1.fsx(123,9,123,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(124,109,124,112): typecheck error FS0001: This expression was expected to have type 'int16' but here has type 'float' +neg1.fsx(124,9,124,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(125,109,125,113): typecheck error FS0001: This expression was expected to have type 'int16' but here has type 'float32' +neg1.fsx(125,9,125,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(126,109,126,112): typecheck error FS0001: This expression was expected to have type 'int16' but here has type 'string' +neg1.fsx(126,9,126,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(127,109,127,112): typecheck error FS0001: This expression was expected to have type 'int16' but here has type 'char' +neg1.fsx(127,9,127,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(128,109,128,113): typecheck error FS0001: This expression was expected to have type 'int16' but here has type 'bool' +neg1.fsx(128,9,128,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(132,103,132,105): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'int64'. neg1.fsx(133,103,133,104): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'int64'. @@ -751,66 +829,92 @@ neg1.fsx(147,109,147,110): typecheck error FS0001: This expression was expected but here has type 'int' +neg1.fsx(147,9,147,111): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(148,109,148,111): typecheck error FS0001: This expression was expected to have type 'int64' but here has type 'int16' +neg1.fsx(148,9,148,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(149,109,149,111): typecheck error FS0001: This expression was expected to have type 'int64' but here has type 'sbyte' +neg1.fsx(149,9,149,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(150,109,150,112): typecheck error FS0001: This expression was expected to have type 'int64' but here has type 'uint64' +neg1.fsx(150,9,150,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(151,109,151,112): typecheck error FS0001: This expression was expected to have type 'int64' but here has type 'byte' +neg1.fsx(151,9,151,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(152,109,152,111): typecheck error FS0001: This expression was expected to have type 'int64' but here has type 'uint32' +neg1.fsx(152,9,152,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(153,109,153,112): typecheck error FS0001: This expression was expected to have type 'int64' but here has type 'uint16' +neg1.fsx(153,9,153,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(154,109,154,113): typecheck error FS0001: This expression was expected to have type 'int64' but here has type 'decimal' +neg1.fsx(154,9,154,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(155,109,155,112): typecheck error FS0001: This expression was expected to have type 'int64' but here has type 'float' +neg1.fsx(155,9,155,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(156,109,156,113): typecheck error FS0001: This expression was expected to have type 'int64' but here has type 'float32' +neg1.fsx(156,9,156,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(157,109,157,112): typecheck error FS0001: This expression was expected to have type 'int64' but here has type 'string' +neg1.fsx(157,9,157,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(158,109,158,112): typecheck error FS0001: This expression was expected to have type 'int64' but here has type 'char' +neg1.fsx(158,9,158,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(159,109,159,113): typecheck error FS0001: This expression was expected to have type 'int64' but here has type 'bool' +neg1.fsx(159,9,159,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(163,104,163,106): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'uint64'. neg1.fsx(164,104,164,105): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'uint64'. @@ -842,66 +946,92 @@ neg1.fsx(177,110,177,112): typecheck error FS0001: This expression was expected but here has type 'int64' +neg1.fsx(177,9,177,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(178,110,178,112): typecheck error FS0001: This expression was expected to have type 'uint64' but here has type 'int16' +neg1.fsx(178,9,178,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(179,110,179,112): typecheck error FS0001: This expression was expected to have type 'uint64' but here has type 'sbyte' +neg1.fsx(179,9,179,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(180,110,180,111): typecheck error FS0001: This expression was expected to have type 'uint64' but here has type 'int' +neg1.fsx(180,9,180,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(181,110,181,113): typecheck error FS0001: This expression was expected to have type 'uint64' but here has type 'byte' +neg1.fsx(181,9,181,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(182,110,182,112): typecheck error FS0001: This expression was expected to have type 'uint64' but here has type 'uint32' +neg1.fsx(182,9,182,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(183,110,183,113): typecheck error FS0001: This expression was expected to have type 'uint64' but here has type 'uint16' +neg1.fsx(183,9,183,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(184,110,184,114): typecheck error FS0001: This expression was expected to have type 'uint64' but here has type 'decimal' +neg1.fsx(184,9,184,115): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(185,110,185,113): typecheck error FS0001: This expression was expected to have type 'uint64' but here has type 'float' +neg1.fsx(185,9,185,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(186,110,186,114): typecheck error FS0001: This expression was expected to have type 'uint64' but here has type 'float32' +neg1.fsx(186,9,186,115): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(187,110,187,113): typecheck error FS0001: This expression was expected to have type 'uint64' but here has type 'string' +neg1.fsx(187,9,187,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(188,110,188,113): typecheck error FS0001: This expression was expected to have type 'uint64' but here has type 'char' +neg1.fsx(188,9,188,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(189,110,189,114): typecheck error FS0001: This expression was expected to have type 'uint64' but here has type 'bool' +neg1.fsx(189,9,189,115): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(193,104,193,106): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'uint32'. neg1.fsx(194,104,194,105): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'uint32'. @@ -933,66 +1063,92 @@ neg1.fsx(208,110,208,112): typecheck error FS0001: This expression was expected but here has type 'int64' +neg1.fsx(208,9,208,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(209,110,209,112): typecheck error FS0001: This expression was expected to have type 'uint32' but here has type 'int16' +neg1.fsx(209,9,209,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(210,110,210,112): typecheck error FS0001: This expression was expected to have type 'uint32' but here has type 'sbyte' +neg1.fsx(210,9,210,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(211,110,211,113): typecheck error FS0001: This expression was expected to have type 'uint32' but here has type 'uint64' +neg1.fsx(211,9,211,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(212,110,212,113): typecheck error FS0001: This expression was expected to have type 'uint32' but here has type 'byte' +neg1.fsx(212,9,212,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(213,110,213,111): typecheck error FS0001: This expression was expected to have type 'uint32' but here has type 'int' +neg1.fsx(213,9,213,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(214,110,214,113): typecheck error FS0001: This expression was expected to have type 'uint32' but here has type 'uint16' +neg1.fsx(214,9,214,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(215,110,215,114): typecheck error FS0001: This expression was expected to have type 'uint32' but here has type 'decimal' +neg1.fsx(215,9,215,115): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(216,110,216,113): typecheck error FS0001: This expression was expected to have type 'uint32' but here has type 'float' +neg1.fsx(216,9,216,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(217,110,217,114): typecheck error FS0001: This expression was expected to have type 'uint32' but here has type 'float32' +neg1.fsx(217,9,217,115): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(218,110,218,113): typecheck error FS0001: This expression was expected to have type 'uint32' but here has type 'string' +neg1.fsx(218,9,218,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(219,110,219,113): typecheck error FS0001: This expression was expected to have type 'uint32' but here has type 'char' +neg1.fsx(219,9,219,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(220,110,220,114): typecheck error FS0001: This expression was expected to have type 'uint32' but here has type 'bool' +neg1.fsx(220,9,220,115): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(224,104,224,106): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'uint16'. neg1.fsx(225,104,225,105): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'uint16'. @@ -1024,66 +1180,92 @@ neg1.fsx(239,110,239,112): typecheck error FS0001: This expression was expected but here has type 'int64' +neg1.fsx(239,9,239,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(240,110,240,112): typecheck error FS0001: This expression was expected to have type 'uint16' but here has type 'int16' +neg1.fsx(240,9,240,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(241,110,241,112): typecheck error FS0001: This expression was expected to have type 'uint16' but here has type 'sbyte' +neg1.fsx(241,9,241,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(242,110,242,113): typecheck error FS0001: This expression was expected to have type 'uint16' but here has type 'uint64' +neg1.fsx(242,9,242,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(243,110,243,113): typecheck error FS0001: This expression was expected to have type 'uint16' but here has type 'byte' +neg1.fsx(243,9,243,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(244,110,244,112): typecheck error FS0001: This expression was expected to have type 'uint16' but here has type 'uint32' +neg1.fsx(244,9,244,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(245,110,245,111): typecheck error FS0001: This expression was expected to have type 'uint16' but here has type 'int' +neg1.fsx(245,9,245,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(246,110,246,114): typecheck error FS0001: This expression was expected to have type 'uint16' but here has type 'decimal' +neg1.fsx(246,9,246,115): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(247,110,247,113): typecheck error FS0001: This expression was expected to have type 'uint16' but here has type 'float' +neg1.fsx(247,9,247,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(248,110,248,114): typecheck error FS0001: This expression was expected to have type 'uint16' but here has type 'float32' +neg1.fsx(248,9,248,115): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(249,110,249,113): typecheck error FS0001: This expression was expected to have type 'uint16' but here has type 'string' +neg1.fsx(249,9,249,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(250,110,250,113): typecheck error FS0001: This expression was expected to have type 'uint16' but here has type 'char' +neg1.fsx(250,9,250,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(251,110,251,114): typecheck error FS0001: This expression was expected to have type 'uint16' but here has type 'bool' +neg1.fsx(251,9,251,115): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(255,102,255,104): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'byte'. neg1.fsx(256,102,256,103): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'byte'. @@ -1115,66 +1297,92 @@ neg1.fsx(269,108,269,110): typecheck error FS0001: This expression was expected but here has type 'int64' +neg1.fsx(269,9,269,111): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(270,108,270,110): typecheck error FS0001: This expression was expected to have type 'byte' but here has type 'int16' +neg1.fsx(270,9,270,111): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(271,108,271,110): typecheck error FS0001: This expression was expected to have type 'byte' but here has type 'sbyte' +neg1.fsx(271,9,271,111): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(272,108,272,111): typecheck error FS0001: This expression was expected to have type 'byte' but here has type 'uint64' +neg1.fsx(272,9,272,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(273,108,273,109): typecheck error FS0001: This expression was expected to have type 'byte' but here has type 'int' +neg1.fsx(273,9,273,110): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(274,108,274,110): typecheck error FS0001: This expression was expected to have type 'byte' but here has type 'uint32' +neg1.fsx(274,9,274,111): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(275,108,275,111): typecheck error FS0001: This expression was expected to have type 'byte' but here has type 'uint16' +neg1.fsx(275,9,275,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(276,108,276,112): typecheck error FS0001: This expression was expected to have type 'byte' but here has type 'decimal' +neg1.fsx(276,9,276,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(277,108,277,111): typecheck error FS0001: This expression was expected to have type 'byte' but here has type 'float' +neg1.fsx(277,9,277,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(278,108,278,112): typecheck error FS0001: This expression was expected to have type 'byte' but here has type 'float32' +neg1.fsx(278,9,278,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(279,108,279,111): typecheck error FS0001: This expression was expected to have type 'byte' but here has type 'string' +neg1.fsx(279,9,279,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(280,108,280,111): typecheck error FS0001: This expression was expected to have type 'byte' but here has type 'char' +neg1.fsx(280,9,280,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(281,108,281,112): typecheck error FS0001: This expression was expected to have type 'byte' but here has type 'bool' +neg1.fsx(281,9,281,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(285,102,285,104): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'bool'. neg1.fsx(286,102,286,103): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'bool'. @@ -1206,66 +1414,92 @@ neg1.fsx(299,108,299,110): typecheck error FS0001: This expression was expected but here has type 'int64' +neg1.fsx(299,9,299,111): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(300,108,300,110): typecheck error FS0001: This expression was expected to have type 'bool' but here has type 'int16' +neg1.fsx(300,9,300,111): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(301,108,301,110): typecheck error FS0001: This expression was expected to have type 'bool' but here has type 'sbyte' +neg1.fsx(301,9,301,111): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(302,108,302,111): typecheck error FS0001: This expression was expected to have type 'bool' but here has type 'uint64' +neg1.fsx(302,9,302,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(303,108,303,111): typecheck error FS0001: This expression was expected to have type 'bool' but here has type 'byte' +neg1.fsx(303,9,303,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(304,108,304,110): typecheck error FS0001: This expression was expected to have type 'bool' but here has type 'uint32' +neg1.fsx(304,9,304,111): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(305,108,305,111): typecheck error FS0001: This expression was expected to have type 'bool' but here has type 'uint16' +neg1.fsx(305,9,305,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(306,108,306,112): typecheck error FS0001: This expression was expected to have type 'bool' but here has type 'decimal' +neg1.fsx(306,9,306,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(307,108,307,111): typecheck error FS0001: This expression was expected to have type 'bool' but here has type 'float' +neg1.fsx(307,9,307,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(308,108,308,112): typecheck error FS0001: This expression was expected to have type 'bool' but here has type 'float32' +neg1.fsx(308,9,308,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(309,108,309,111): typecheck error FS0001: This expression was expected to have type 'bool' but here has type 'string' +neg1.fsx(309,9,309,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(310,108,310,111): typecheck error FS0001: This expression was expected to have type 'bool' but here has type 'char' +neg1.fsx(310,9,310,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(311,108,311,109): typecheck error FS0001: This expression was expected to have type 'bool' but here has type 'int' +neg1.fsx(311,9,311,110): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(315,104,315,106): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'string'. neg1.fsx(316,104,316,105): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'string'. @@ -1299,66 +1533,92 @@ neg1.fsx(329,110,329,112): typecheck error FS0001: This expression was expected but here has type 'int64' +neg1.fsx(329,9,329,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Unable to cast object of type 'System.Int64' to type 'System.String'. + neg1.fsx(330,110,330,112): typecheck error FS0001: This expression was expected to have type 'string' but here has type 'int16' +neg1.fsx(330,9,330,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Unable to cast object of type 'System.Int16' to type 'System.String'. + neg1.fsx(331,110,331,112): typecheck error FS0001: This expression was expected to have type 'string' but here has type 'sbyte' +neg1.fsx(331,9,331,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Unable to cast object of type 'System.SByte' to type 'System.String'. + neg1.fsx(332,110,332,113): typecheck error FS0001: This expression was expected to have type 'string' but here has type 'uint64' +neg1.fsx(332,9,332,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Unable to cast object of type 'System.UInt64' to type 'System.String'. + neg1.fsx(333,110,333,113): typecheck error FS0001: This expression was expected to have type 'string' but here has type 'byte' +neg1.fsx(333,9,333,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Unable to cast object of type 'System.Byte' to type 'System.String'. + neg1.fsx(334,110,334,112): typecheck error FS0001: This expression was expected to have type 'string' but here has type 'uint32' +neg1.fsx(334,9,334,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Unable to cast object of type 'System.UInt32' to type 'System.String'. + neg1.fsx(335,110,335,113): typecheck error FS0001: This expression was expected to have type 'string' but here has type 'uint16' +neg1.fsx(335,9,335,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Unable to cast object of type 'System.UInt16' to type 'System.String'. + neg1.fsx(336,110,336,114): typecheck error FS0001: This expression was expected to have type 'string' but here has type 'decimal' +neg1.fsx(336,9,336,115): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Unable to cast object of type 'System.Decimal' to type 'System.String'. + neg1.fsx(337,110,337,113): typecheck error FS0001: This expression was expected to have type 'string' but here has type 'float' +neg1.fsx(337,9,337,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Unable to cast object of type 'System.Double' to type 'System.String'. + neg1.fsx(338,110,338,114): typecheck error FS0001: This expression was expected to have type 'string' but here has type 'float32' +neg1.fsx(338,9,338,115): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Unable to cast object of type 'System.Single' to type 'System.String'. + neg1.fsx(339,110,339,111): typecheck error FS0001: This expression was expected to have type 'string' but here has type 'int' +neg1.fsx(339,9,339,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Unable to cast object of type 'System.Int32' to type 'System.String'. + neg1.fsx(340,110,340,113): typecheck error FS0001: This expression was expected to have type 'string' but here has type 'char' +neg1.fsx(340,9,340,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Unable to cast object of type 'System.Char' to type 'System.String'. + neg1.fsx(341,110,341,114): typecheck error FS0001: This expression was expected to have type 'string' but here has type 'bool' +neg1.fsx(341,9,341,115): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Unable to cast object of type 'System.Boolean' to type 'System.String'. + neg1.fsx(342,104,342,114): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'string'. neg1.fsx(345,104,345,106): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'float'. @@ -1392,66 +1652,92 @@ neg1.fsx(359,110,359,112): typecheck error FS0001: This expression was expected but here has type 'int64' +neg1.fsx(359,9,359,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(360,110,360,112): typecheck error FS0001: This expression was expected to have type 'float' but here has type 'int16' +neg1.fsx(360,9,360,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(361,110,361,112): typecheck error FS0001: This expression was expected to have type 'float' but here has type 'sbyte' +neg1.fsx(361,9,361,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(362,110,362,113): typecheck error FS0001: This expression was expected to have type 'float' but here has type 'uint64' +neg1.fsx(362,9,362,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(363,110,363,113): typecheck error FS0001: This expression was expected to have type 'float' but here has type 'byte' +neg1.fsx(363,9,363,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(364,110,364,112): typecheck error FS0001: This expression was expected to have type 'float' but here has type 'uint32' +neg1.fsx(364,9,364,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(365,110,365,113): typecheck error FS0001: This expression was expected to have type 'float' but here has type 'uint16' +neg1.fsx(365,9,365,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(366,110,366,114): typecheck error FS0001: This expression was expected to have type 'float' but here has type 'decimal' +neg1.fsx(366,9,366,115): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(367,110,367,111): typecheck error FS0001: This expression was expected to have type 'float' but here has type 'int' +neg1.fsx(367,9,367,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(368,110,368,114): typecheck error FS0001: This expression was expected to have type 'float' but here has type 'float32' +neg1.fsx(368,9,368,115): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(369,110,369,113): typecheck error FS0001: This expression was expected to have type 'float' but here has type 'string' +neg1.fsx(369,9,369,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(370,110,370,113): typecheck error FS0001: This expression was expected to have type 'float' but here has type 'char' +neg1.fsx(370,9,370,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(371,110,371,114): typecheck error FS0001: This expression was expected to have type 'float' but here has type 'bool' +neg1.fsx(371,9,371,115): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(376,104,376,106): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'float32'. neg1.fsx(377,104,377,105): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'float32'. @@ -1483,66 +1769,92 @@ neg1.fsx(390,110,390,112): typecheck error FS0001: This expression was expected but here has type 'int64' +neg1.fsx(390,9,390,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(391,110,391,112): typecheck error FS0001: This expression was expected to have type 'float32' but here has type 'int16' +neg1.fsx(391,9,391,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(392,110,392,112): typecheck error FS0001: This expression was expected to have type 'float32' but here has type 'sbyte' +neg1.fsx(392,9,392,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(393,110,393,113): typecheck error FS0001: This expression was expected to have type 'float32' but here has type 'uint64' +neg1.fsx(393,9,393,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(394,110,394,113): typecheck error FS0001: This expression was expected to have type 'float32' but here has type 'byte' +neg1.fsx(394,9,394,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(395,110,395,112): typecheck error FS0001: This expression was expected to have type 'float32' but here has type 'uint32' +neg1.fsx(395,9,395,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(396,110,396,113): typecheck error FS0001: This expression was expected to have type 'float32' but here has type 'uint16' +neg1.fsx(396,9,396,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(397,110,397,114): typecheck error FS0001: This expression was expected to have type 'float32' but here has type 'decimal' +neg1.fsx(397,9,397,115): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(398,110,398,113): typecheck error FS0001: This expression was expected to have type 'float32' but here has type 'float' +neg1.fsx(398,9,398,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(399,110,399,111): typecheck error FS0001: This expression was expected to have type 'float32' but here has type 'int' +neg1.fsx(399,9,399,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(400,110,400,113): typecheck error FS0001: This expression was expected to have type 'float32' but here has type 'string' +neg1.fsx(400,9,400,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(401,110,401,113): typecheck error FS0001: This expression was expected to have type 'float32' but here has type 'char' +neg1.fsx(401,9,401,114): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(402,110,402,114): typecheck error FS0001: This expression was expected to have type 'float32' but here has type 'bool' +neg1.fsx(402,9,402,115): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(406,102,406,104): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'char'. neg1.fsx(407,102,407,103): typecheck error FS3045: Invalid static argument to provided type. Expected an argument of kind 'char'. @@ -1574,81 +1886,113 @@ neg1.fsx(420,108,420,110): typecheck error FS0001: This expression was expected but here has type 'int64' +neg1.fsx(420,9,420,111): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(421,108,421,110): typecheck error FS0001: This expression was expected to have type 'char' but here has type 'int16' +neg1.fsx(421,9,421,111): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(422,108,422,110): typecheck error FS0001: This expression was expected to have type 'char' but here has type 'sbyte' +neg1.fsx(422,9,422,111): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(423,108,423,111): typecheck error FS0001: This expression was expected to have type 'char' but here has type 'uint64' +neg1.fsx(423,9,423,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(424,108,424,111): typecheck error FS0001: This expression was expected to have type 'char' but here has type 'byte' +neg1.fsx(424,9,424,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(425,108,425,110): typecheck error FS0001: This expression was expected to have type 'char' but here has type 'uint32' +neg1.fsx(425,9,425,111): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(426,108,426,111): typecheck error FS0001: This expression was expected to have type 'char' but here has type 'uint16' +neg1.fsx(426,9,426,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(427,108,427,112): typecheck error FS0001: This expression was expected to have type 'char' but here has type 'decimal' +neg1.fsx(427,9,427,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(428,108,428,111): typecheck error FS0001: This expression was expected to have type 'char' but here has type 'float' +neg1.fsx(428,9,428,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(429,108,429,112): typecheck error FS0001: This expression was expected to have type 'char' but here has type 'float32' +neg1.fsx(429,9,429,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(430,108,430,111): typecheck error FS0001: This expression was expected to have type 'char' but here has type 'string' +neg1.fsx(430,9,430,112): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(431,108,431,109): typecheck error FS0001: This expression was expected to have type 'char' but here has type 'int' +neg1.fsx(431,9,431,110): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(432,108,432,112): typecheck error FS0001: This expression was expected to have type 'char' but here has type 'bool' +neg1.fsx(432,9,432,113): typecheck error FS3033: The type provider 'Provider.GoodProviderForNegativeStaticParameterTypeTests' reported an error: Specified cast is not valid. + neg1.fsx(438,109,438,110): typecheck error FS0001: This expression was expected to have type 'int' 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/neg103.bsl b/tests/fsharp/typecheck/sigs/neg103.bsl index e59a1669e7b..bd3c24f230f 100644 --- a/tests/fsharp/typecheck/sigs/neg103.bsl +++ b/tests/fsharp/typecheck/sigs/neg103.bsl @@ -19,21 +19,19 @@ neg103.fs(12,26,12,34): typecheck error FS0001: This expression was expected to but here has type 'MyUnion' -neg103.fs(11,5,11,11): typecheck error FS0025: Incomplete pattern matches on this expression. - neg103.fs(17,7,17,15): typecheck error FS0001: This expression was expected to have type 'int' but here has type 'MyUnion' -neg103.fs(15,5,15,11): typecheck error FS0025: Incomplete pattern matches on this expression. +neg103.fs(15,5,15,11): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value 'CaseB' may indicate a case not covered by the pattern(s). neg103.fs(21,7,21,9): typecheck error FS0001: This expression was expected to have type 'Async' but here has type 'int' -neg103.fs(20,5,20,11): typecheck error FS0025: Incomplete pattern matches on this expression. +neg103.fs(20,5,20,11): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s). neg103.fs(25,11,25,19): typecheck error FS0001: This expression was expected to have type 'int' @@ -50,4 +48,3 @@ neg103.fs(25,30,25,38): typecheck error FS0001: This expression was expected to but here has type 'MyUnion' -neg103.fs(24,9,24,15): typecheck error FS0025: Incomplete pattern matches on this expression. diff --git a/tests/fsharp/typecheck/sigs/neg103.vsbsl b/tests/fsharp/typecheck/sigs/neg103.vsbsl index e59a1669e7b..5dcee40c764 100644 --- a/tests/fsharp/typecheck/sigs/neg103.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg103.vsbsl @@ -19,21 +19,19 @@ neg103.fs(12,26,12,34): typecheck error FS0001: This expression was expected to but here has type 'MyUnion' -neg103.fs(11,5,11,11): typecheck error FS0025: Incomplete pattern matches on this expression. - neg103.fs(17,7,17,15): typecheck error FS0001: This expression was expected to have type 'int' but here has type 'MyUnion' -neg103.fs(15,5,15,11): typecheck error FS0025: Incomplete pattern matches on this expression. +neg103.fs(15,5,15,11): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value 'CaseB' may indicate a case not covered by the pattern(s). neg103.fs(21,7,21,9): typecheck error FS0001: This expression was expected to have type 'Async' but here has type 'int' -neg103.fs(20,5,20,11): typecheck error FS0025: Incomplete pattern matches on this expression. +neg103.fs(20,5,20,11): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s). neg103.fs(25,11,25,19): typecheck error FS0001: This expression was expected to have type 'int' @@ -49,5 +47,3 @@ neg103.fs(25,30,25,38): typecheck error FS0001: This expression was expected to 'int' but here has type 'MyUnion' - -neg103.fs(24,9,24,15): typecheck error FS0025: Incomplete pattern matches on this expression. diff --git a/tests/fsharp/typecheck/sigs/neg28.bsl b/tests/fsharp/typecheck/sigs/neg28.bsl index 1728d50334c..f1942cbaea2 100644 --- a/tests/fsharp/typecheck/sigs/neg28.bsl +++ b/tests/fsharp/typecheck/sigs/neg28.bsl @@ -31,8 +31,12 @@ neg28.fsx(69,39,69,40): typecheck error FS0001: The type 'int -> int' does not s neg28.fsx(70,17,70,34): typecheck error FS0001: The type 'int -> int' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface +neg28.fsx(70,39,70,40): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type + neg28.fsx(71,17,71,38): typecheck error FS0001: The type 'int -> int' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface +neg28.fsx(71,43,71,44): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type + neg28.fsx(79,17,79,39): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface neg28.fsx(80,17,80,41): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface diff --git a/tests/fsharp/typecheck/sigs/neg30.bsl b/tests/fsharp/typecheck/sigs/neg30.bsl index 67f4ba2cd53..49c3924cf5b 100644 --- a/tests/fsharp/typecheck/sigs/neg30.bsl +++ b/tests/fsharp/typecheck/sigs/neg30.bsl @@ -9,16 +9,28 @@ neg30.fs(45,7,45,16): typecheck error FS0001: A generic construct requires that neg30.fs(46,7,46,26): typecheck error FS0001: A generic construct requires that the type 'SBadRecursion' is an unmanaged type +neg30.fs(46,7,46,26): typecheck error FS1133: No constructors are available for the type 'SBadRecursion' + neg30.fs(47,6,47,8): typecheck error FS0001: A generic construct requires that the type 'FSharpUnion' is an unmanaged type +neg30.fs(59,9,59,26): typecheck error FS0001: A generic construct requires that the type 'SManaged' is an unmanaged type + neg30.fs(59,13,59,24): typecheck error FS0001: A generic construct requires that the type 'SManaged' is an unmanaged type +neg30.fs(60,9,60,35): typecheck error FS0001: A generic construct requires that the type 'SManagedRecursive' is an unmanaged type + neg30.fs(60,13,60,33): typecheck error FS0001: A generic construct requires that the type 'SManagedRecursive' is an unmanaged type +neg30.fs(61,9,61,21): typecheck error FS0001: A generic construct requires that the type 'obj' is an unmanaged type + neg30.fs(61,13,61,19): typecheck error FS0001: A generic construct requires that the type 'obj' is an unmanaged type +neg30.fs(62,9,62,31): typecheck error FS0001: A generic construct requires that the type 'SBadRecursion' is an unmanaged type + neg30.fs(62,13,62,29): typecheck error FS0001: A generic construct requires that the type 'SBadRecursion' is an unmanaged type +neg30.fs(63,9,63,29): typecheck error FS0001: A generic construct requires that the type 'FSharpUnion' is an unmanaged type + neg30.fs(63,13,63,27): typecheck error FS0001: A generic construct requires that the type 'FSharpUnion' is an unmanaged type neg30.fs(71,12,71,35): typecheck error FS0120: hello! diff --git a/tests/fsharp/typecheck/sigs/neg45.bsl b/tests/fsharp/typecheck/sigs/neg45.bsl index 3ec59a417f6..cecac3eb55b 100644 --- a/tests/fsharp/typecheck/sigs/neg45.bsl +++ b/tests/fsharp/typecheck/sigs/neg45.bsl @@ -25,8 +25,6 @@ neg45.fs(64,19,64,20): typecheck error FS0025: Incomplete pattern matches on thi neg45.fs(72,26,72,31): typecheck error FS0001: A type parameter is missing a constraint 'when 'T :> System.IComparable' -neg45.fs(72,10,72,19): typecheck error FS0035: This construct is deprecated: This type abbreviation has one or more declared type parameters that do not appear in the type being abbreviated. Type abbreviations must use all declared type parameters in the type being abbreviated. Consider removing one or more type parameters, or use a concrete type definition that wraps an underlying type, such as 'type C<'a> = C of ...'. - neg45.fs(73,36,73,41): typecheck error FS0001: A type parameter is missing a constraint 'when 'T :> System.IComparable' neg45.fs(73,36,73,41): typecheck error FS0193: A type parameter is missing a constraint 'when 'T :> System.IComparable' diff --git a/tests/fsharp/typecheck/sigs/neg60.bsl b/tests/fsharp/typecheck/sigs/neg60.bsl index 06ee5dbc874..166007b0e3d 100644 --- a/tests/fsharp/typecheck/sigs/neg60.bsl +++ b/tests/fsharp/typecheck/sigs/neg60.bsl @@ -6,6 +6,8 @@ neg60.fs(65,19,65,38): typecheck error FS0001: This expression was expected to h but here has type 'unit' +neg60.fs(66,34,66,35): typecheck error FS0039: The value or constructor 'x' is not defined. + neg60.fs(71,36,71,40): typecheck error FS0043: The type 'System.Nullable' does not have 'null' as a proper value. To create a null value for a Nullable type use 'System.Nullable()'. neg60.fs(77,16,77,19): typecheck error FS0043: The type 'System.Nullable' does not support the operator '?>='. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. @@ -14,7 +16,7 @@ neg60.fs(78,16,78,19): typecheck error FS0043: None of the types 'System.Nullabl neg60.fs(79,18,79,21): typecheck error FS0001: The type ''a * 'b' does not match the type 'int' -neg60.fs(79,15,79,16): typecheck error FS0043: The type ''a * 'b' does not match the type 'int' +neg60.fs(79,15,79,16): typecheck error FS0043: The type 'int * int' does not match the type 'int' neg60.fs(80,22,80,25): typecheck error FS0001: Expecting a type supporting the operator '+' but given a tuple type diff --git a/tests/fsharp/typecheck/sigs/neg68.bsl b/tests/fsharp/typecheck/sigs/neg68.bsl index 6bc722f0f1b..90d9dc41e83 100644 --- a/tests/fsharp/typecheck/sigs/neg68.bsl +++ b/tests/fsharp/typecheck/sigs/neg68.bsl @@ -1,2 +1,4 @@ -neg68.fsx(71,46,71,47): parse error FS0010: Unexpected symbol ')' in binding. Expected incomplete structured construct at or before this point or other token. +neg68.fsx(138,15,138,16): typecheck info FS3370: The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. + +neg68.fsx(158,24,158,26): typecheck info FS3370: The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. diff --git a/tests/fsharp/typecheck/sigs/neg68.fsx b/tests/fsharp/typecheck/sigs/neg68.fsx index 88bec11c73a..d9362118200 100644 --- a/tests/fsharp/typecheck/sigs/neg68.fsx +++ b/tests/fsharp/typecheck/sigs/neg68.fsx @@ -68,7 +68,7 @@ type sRealTime [] type pixels -let G = 6.67e-11 +let G = 6.67e-11 let m_per_AU = 149597870691.0 let AU_per_m = 1.0/m_per_AU let Pixels_per_AU = 200.0 diff --git a/tests/fsharp/typecheck/sigs/neg68.vsbsl b/tests/fsharp/typecheck/sigs/neg68.vsbsl index 369c1e15865..aa0620845c8 100644 --- a/tests/fsharp/typecheck/sigs/neg68.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg68.vsbsl @@ -1,26 +1,3 @@ +neg68.fsx(138,15,138,16): typecheck info FS3370: The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. -neg68.fsx(71,46,71,47): parse error FS0010: Unexpected symbol ')' in binding. Expected incomplete structured construct at or before this point or other token. - -neg68.fsx(71,32,71,33): typecheck error FS0062: This construct is for ML compatibility. Consider using the '+' operator instead. This may require a type annotation to indicate it acts on strings. This message can be disabled using '--nowarn:62' or '#nowarn "62"'. - -neg68.fsx(71,30,71,46): typecheck error FS0001: This expression was expected to have type - 'float' -but here has type - 'string' - -neg68.fsx(71,30,71,31): typecheck error FS1133: No constructors are available for the type 'm' - -neg68.fsx(71,43,71,44): typecheck error FS0062: This construct is for ML compatibility. Consider using the '+' operator instead. This may require a type annotation to indicate it acts on strings. This message can be disabled using '--nowarn:62' or '#nowarn "62"'. - -neg68.fsx(71,39,71,45): typecheck error FS0001: The type 'string' does not match the type 'int' - -neg68.fsx(71,39,71,41): typecheck error FS1133: No constructors are available for the type 'kg' - -neg68.fsx(71,44,71,45): typecheck error FS0001: This expression was expected to have type - 'string' -but here has type - 'int' - -neg68.fsx(123,40,123,41): typecheck error FS0001: The type 'bool' does not match the type 'float<'u>' - -neg68.fsx(123,38,123,39): typecheck error FS0043: The type 'bool' does not match the type 'float<'u>' +neg68.fsx(158,24,158,26): typecheck info FS3370: The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. diff --git a/tests/fsharp/typecheck/sigs/version47/neg24.bsl b/tests/fsharp/typecheck/sigs/version47/neg24.bsl index 192de09f93d..f4bd1eed0e2 100644 --- a/tests/fsharp/typecheck/sigs/version47/neg24.bsl +++ b/tests/fsharp/typecheck/sigs/version47/neg24.bsl @@ -26,11 +26,23 @@ neg24.fs(305,24,305,25): typecheck error FS0001: This expression was expected to but here has type 'int' +neg24.fs(305,24,305,25): typecheck error FS0193: Type constraint mismatch. The type + 'int' +is not compatible with type + 'unit' + + neg24.fs(305,31,305,32): typecheck error FS0001: This expression was expected to have type 'unit' but here has type 'int' +neg24.fs(305,31,305,32): typecheck error FS0193: Type constraint mismatch. The type + 'int' +is not compatible with type + 'unit' + + neg24.fs(308,30,308,31): typecheck error FS0020: The result of this expression has type 'int' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. neg24.fs(309,31,309,32): typecheck error FS0001: This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type 'int'.