Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ module TestFrameworkAdapter =
let singleTestBuildAndRunIsolated folder mode = singleTestBuildAndRunVersion folder mode LangVersion.Latest ScriptSessionIsolation.Isolated

let singleVersionedNegTestAux folder bonusArgs version testName =
singleTestBuildAndRunAuxVersion folder bonusArgs (NEG_TEST_BUILD testName) version
singleTestBuildAndRunAuxVersion folder bonusArgs (NEG_TEST_BUILD testName) version ScriptSessionIsolation.Shared
let singleVersionedNegTest (folder:string) (version:LangVersion) (testName:string) =
singleVersionedNegTestAux folder [] version testName
let singleNegTest folder testName = singleVersionedNegTest folder LangVersion.Latest testName
17 changes: 10 additions & 7 deletions tests/FSharp.Test.Utilities/Compiler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1833,15 +1833,18 @@ Actual:
let expectedContent = File.ReadAllText(path) |> normalizeNewLines
let actualErrors = renderToString result

match Environment.GetEnvironmentVariable("TEST_UPDATE_BSL") with
| null -> ()
| _ when expectedContent = actualErrors -> ()
| _ -> File.WriteAllText(path, actualErrors)
//File.WriteAllText(path, actualErrors)

match Assert.shouldBeSameMultilineStringSets expectedContent actualErrors with
| None -> ()
| Some diff -> Assert.True(String.IsNullOrEmpty(diff), path)
| Some diff ->
if Environment.GetEnvironmentVariable("TEST_UPDATE_BSL") <> null then
File.WriteAllText(path, actualErrors)

printfn $"{Path.GetFullPath path} \n {diff}"
printfn "==========================EXPECTED==========================="
printfn "%s" expectedContent
printfn "===========================ACTUAL============================"
printfn "%s" actualErrors
Assert.True(String.IsNullOrEmpty(diff), path)

result

Expand Down
2 changes: 1 addition & 1 deletion tests/fsharp/typecheck/sigs/neg04.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ neg04.fs(159,47,159,57): typecheck error FS0692: This function value is being us

neg04.fs(163,54,163,67): typecheck error FS0692: This function value is being used to construct a delegate type whose signature includes a byref argument. You must use an explicit lambda expression taking 1 arguments.

neg04.fs(178,13,178,18): typecheck error FS0001: The type '('a -> unit)' does not support the 'equality' constraint because it is a function type
neg04.fs(178,13,178,18): typecheck error FS0001: The type ''a -> unit' does not support the 'equality' constraint because it is a function type
22 changes: 22 additions & 0 deletions tests/fsharp/typecheck/sigs/neg05.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,25 @@ neg05.fs(57,15,57,18): typecheck error FS1198: The generic member 'Pop' has been
neg05.fs(51,11,51,13): typecheck error FS0663: This type parameter has been used in a way that constrains it to always be 'unit'

neg05.fs(51,11,51,13): typecheck error FS0660: This code is less generic than required by its annotations because the explicit type variable 'a' could not be generalized. It was constrained to be 'unit'.

neg05.fs(12,3,12,9): typecheck error FS0842: This attribute cannot be applied to interface. Valid targets are: class, struct, parameter, return value

neg05.fs(14,5,15,8): typecheck error FS0927: The kind of the type specified by its attributes does not match the kind implied by its definition

neg05.fs(17,3,17,8): typecheck error FS0842: This attribute cannot be applied to interface. Valid targets are: class

neg05.fs(19,5,20,8): typecheck error FS0927: The kind of the type specified by its attributes does not match the kind implied by its definition

neg05.fs(24,5,25,8): typecheck error FS0927: The kind of the type specified by its attributes does not match the kind implied by its definition

neg05.fs(27,3,27,12): typecheck error FS0842: This attribute cannot be applied to class. Valid targets are: interface

neg05.fs(29,5,30,8): typecheck error FS0927: The kind of the type specified by its attributes does not match the kind implied by its definition

neg05.fs(32,3,32,8): typecheck error FS0842: This attribute cannot be applied to struct. Valid targets are: class

neg05.fs(34,5,35,8): typecheck error FS0927: The kind of the type specified by its attributes does not match the kind implied by its definition

neg05.fs(37,3,37,12): typecheck error FS0842: This attribute cannot be applied to struct. Valid targets are: interface

neg05.fs(39,5,40,8): typecheck error FS0927: The kind of the type specified by its attributes does not match the kind implied by its definition
3 changes: 0 additions & 3 deletions tests/fsharp/typecheck/sigs/neg07.bsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

neg07.fs(7,10,7,29): typecheck error FS0049: Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name.

neg07.fs(24,13,24,23): typecheck error FS0039: The value or constructor 'UnionCase1' is not defined. Maybe you want one of the following:
X.UnionCase1

Expand Down
9 changes: 4 additions & 5 deletions tests/fsharp/typecheck/sigs/neg113.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@ neg113.fs(7,41,7,52): typecheck error FS0001: This anonymous record should have

neg113.fs(10,27,10,55): typecheck error FS0059: The type '{| a: int |}' does not have any proper subtypes and need not be used as the target of a static coercion

neg113.fs(10,27,10,55): typecheck error FS0193: Type constraint mismatch. The type
neg113.fs(10,27,10,38): typecheck error FS0193: Type constraint mismatch. The type
'{| b: int |}'
is not compatible with type
'{| a: int |}'


neg113.fs(13,27,13,62): typecheck error FS0059: The type '{| a: int |}' does not have any proper subtypes and need not be used as the target of a static coercion

neg113.fs(13,27,13,62): typecheck error FS0193: Type constraint mismatch. The type
neg113.fs(13,27,13,45): typecheck error FS0193: Type constraint mismatch. The type
'{| a: int; b: int |}'
is not compatible with type
'{| a: int |}'

neg113.fs(18,34,18,36): typecheck error FS0001: The type ''a -> 'a' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface

neg113.fs(18,34,18,36): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface

neg113.fs(20,42,20,44): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface
neg113.fs(20,42,20,44): typecheck error FS0001: The type ''a -> 'a' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface
9 changes: 5 additions & 4 deletions tests/fsharp/typecheck/sigs/neg113.vsbsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@ neg113.fs(7,41,7,52): typecheck error FS0001: This anonymous record should have

neg113.fs(10,27,10,55): typecheck error FS0059: The type '{| a: int |}' does not have any proper subtypes and need not be used as the target of a static coercion

neg113.fs(10,27,10,55): typecheck error FS0193: Type constraint mismatch. The type
neg113.fs(10,27,10,38): typecheck error FS0193: Type constraint mismatch. The type
'{| b: int |}'
is not compatible with type
'{| a: int |}'


neg113.fs(13,27,13,62): typecheck error FS0059: The type '{| a: int |}' does not have any proper subtypes and need not be used as the target of a static coercion

neg113.fs(13,27,13,62): typecheck error FS0193: Type constraint mismatch. The type
neg113.fs(13,27,13,45): typecheck error FS0193: Type constraint mismatch. The type
'{| a: int; b: int |}'
is not compatible with type
'{| a: int |}'


neg113.fs(18,34,18,36): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface
neg113.fs(18,34,18,36): typecheck error FS0001: The type ''a -> 'a' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface

neg113.fs(20,42,20,44): typecheck error FS0001: The type ''a -> 'a' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface

neg113.fs(20,42,20,44): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface
12 changes: 6 additions & 6 deletions tests/fsharp/typecheck/sigs/neg15.fs
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ module M =
static member Method34() = noErrorPrivateValueLaterInferredToInvolvePrivateUnionType := [DefaultTagOfPrivateType(3)]
static member Method35() = noErrorPrivateValueLaterInferredToInvolveInternalUnionType := [DefaultTagOfInternalType(3)]

type Type with
type Type with

// Check we can access private things from an in-file augmentation
member x.NoError51 = x.PrivateProperty
member x.NoError52 = Type.PrivateStaticProperty
static member NoError53 = Type.PrivateStaticProperty
static member NoError54 = Type.PrivateStaticMethod()
// Check we can access private things from an in-file augmentation
member x.NoError51 = x.PrivateProperty
member x.NoError52 = Type.PrivateStaticProperty
static member NoError53 = Type.PrivateStaticProperty
static member NoError54 = Type.PrivateStaticMethod()


module N =
Expand Down
11 changes: 9 additions & 2 deletions tests/fsharp/typecheck/sigs/neg16.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ neg16.fs(44,10,44,11): typecheck error FS0934: Records, union, abbreviations and

neg16.fs(47,10,47,13): typecheck error FS0934: Records, union, abbreviations and struct types cannot have the 'AllowNullLiteral' attribute

neg16.fs(49,7,49,23): typecheck error FS0842: This attribute is not valid for use on this language element
neg16.fs(49,7,49,23): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class, interface

neg16.fs(49,7,49,23): typecheck error FS0842: This attribute cannot be applied to property, field, return value. Valid targets are: class, interface

neg16.fs(52,7,52,23): typecheck error FS0842: This attribute cannot be applied to method, property, field, return value. Valid targets are: class, interface

neg16.fs(52,7,52,23): typecheck error FS0842: This attribute cannot be applied to method, return value. Valid targets are: class, interface

neg16.fs(52,7,52,23): typecheck error FS0842: This attribute is not valid for use on this language element

neg16.fs(59,8,59,17): typecheck error FS0001: This expression was expected to have type
'Choice<'a,'b>'
Expand Down Expand Up @@ -121,4 +126,6 @@ neg16.fs(113,9,113,11): typecheck error FS0879: Volatile fields must be marked '

neg16.fs(116,9,116,10): typecheck error FS0879: Volatile fields must be marked 'mutable' and cannot be thread-static

neg16.fs(119,17,119,18): typecheck error FS0880: Uninitialized 'val' fields must be mutable and marked with the '[<DefaultValue>]' attribute. Consider using a 'let' binding instead of a 'val' field.

neg16.fs(130,10,130,11): typecheck error FS0935: Types with the 'AllowNullLiteral' attribute may only inherit from or implement types which also allow the use of the null literal
Loading
Loading