Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
ef0949c
Copy sources from Versions.props to NuGet.config (#7191)
Jul 11, 2019
0c9ccae
Only check distinct errors (#7140)
forki Jul 11, 2019
598db3e
Use 1-based column numbers in tests (#7141)
forki Jul 11, 2019
fe0426a
Merge pull request #7197 from dotnet/merges/master-to-release/dev16.3
KevinRansom Jul 11, 2019
bf1055c
Update dependencies from https://github.com/dotnet/arcade build 20190…
dotnet-maestro[bot] Jul 11, 2019
13596c4
Merge pull request #7201 from dotnet/merges/master-to-release/dev16.3
KevinRansom Jul 12, 2019
da432e1
Better record and value formatting in tools (#7021)
cartermp Jul 12, 2019
660a545
fix portable PDBs for anon records (#7099)
dsyme Jul 12, 2019
9dc9d0e
fix portable PDBs for anon records (#7099)
dsyme Jul 12, 2019
60c915a
Moving ElseBranchHasWrongTypeTests over to NUnit (#7104)
forki Jul 12, 2019
869c2bb
Port tests for missing else branch to NUnit (#7209)
forki Jul 12, 2019
c80a0cb
Merge pull request #7208 from KevinRansom/cherrypickfix
KevinRansom Jul 12, 2019
2fabdaa
Merge pull request #7213 from dotnet/merges/master-to-release/dev16.3
brettfo Jul 12, 2019
59bfc83
Update dependencies from https://github.com/dotnet/arcade build 20190…
dotnet-maestro[bot] Jul 12, 2019
8ab272a
Update dependencies from https://github.com/dotnet/arcade build 20190…
Jul 13, 2019
1ad5657
Merge pull request #7222 from dotnet/merges/master-to-release/dev16.3
KevinRansom Jul 13, 2019
b7d5efd
Merge branch 'release/dev16.3' into merges/release/fsharp47-to-releas…
KevinRansom Jul 13, 2019
7780cab
Fix Supplementary Character / Surrogate Pair info (no code changes) (…
srutzky Jul 13, 2019
30cce45
Merge pull request #7228 from dotnet/merges/master-to-release/dev16.3
KevinRansom Jul 14, 2019
0abf39c
Merge pull request #7223 from dotnet/merges/release/fsharp47-to-relea…
KevinRansom Jul 14, 2019
f9a8e2a
Update IlxGen.fs (#7227)
TIHan Jul 14, 2019
c79a8ab
Merge pull request #7225 from dotnet/darc-master-1d1b7b40-d7f9-4b9d-9…
KevinRansom Jul 14, 2019
ec8a424
Check for exit code in compiler tests (#7211)
forki Jul 14, 2019
c4dba1f
Moving AccessOfTypeAbbreviationTests over to NUnit (#7226)
sergey-tihon Jul 14, 2019
f720c73
Merge pull request #7230 from dotnet/merges/master-to-release/dev16.3
KevinRansom Jul 14, 2019
75cef56
Moving ConstructorTests over to NUnit (#7236)
sergey-tihon Jul 15, 2019
c7cd220
[master] Update dependencies from dotnet/arcade (#7233)
dotnet-maestro[bot] Jul 15, 2019
0f24b3e
Update dependencies from https://github.com/dotnet/arcade build 20190…
dotnet-maestro[bot] Jul 16, 2019
863ec25
Moving UpcastDowncastTests over to NUnit (#7229)
sergey-tihon Jul 16, 2019
c8bac72
Update dependencies from https://github.com/dotnet/arcade build 20190…
dotnet-maestro[bot] Jul 17, 2019
6980587
Move ErrorMessages/NameResolution Tests to NUnit (#7237)
kMutagene Jul 17, 2019
4cf7b5b
Moving WarnExpressionTests over to NUnit (#7232)
sergey-tihon Jul 17, 2019
2f270f2
Merge pull request #7241 from dotnet/merges/master-to-release/dev16.3
KevinRansom Jul 17, 2019
650805b
move some error and warning tests to NUnit (#7244)
smcl Jul 17, 2019
375fd7c
Update dependencies from https://github.com/dotnet/arcade build 20190…
Jul 18, 2019
8d74566
Merge pull request #7253 from dotnet/darc-master-648345c2-b59c-4cd2-9…
KevinRansom Jul 19, 2019
c423de9
Move UnitGenericAbstractType To Nunit (#7257)
falfaddaghi Jul 19, 2019
4151eb2
Update dependencies from https://github.com/dotnet/arcade build 20190…
dotnet-maestro[bot] Jul 19, 2019
bdb2b79
Moving TypeMismatchTests over to NUnit (#7250)
sergey-tihon Jul 19, 2019
b0e5926
publish pdbs in FSharp.Core.nupkg (#7255)
brettfo Jul 19, 2019
3e7b66d
Enable hash algorithm selection (#7252)
KevinRansom Jul 20, 2019
c70ead8
Update dependencies from https://github.com/dotnet/arcade build 20190…
dotnet-maestro[bot] Jul 20, 2019
ff7b8ff
Improve netcore reference selection (#7263)
KevinRansom Jul 22, 2019
d53a38c
Moving Libraries Control tests to NUnit (#7234)
thinkbeforecoding Jul 22, 2019
5efa8a7
Member constraints and PrimitiveConstraints (#7210)
forki Jul 22, 2019
a7c68c3
Update dependencies from https://github.com/dotnet/arcade build 20190…
dotnet-maestro[bot] Jul 23, 2019
a67156b
Merge branch 'master' into merges/release/dev16.2-to-master
brettfo Jul 24, 2019
0bd851b
Merge pull request #7272 from dotnet/merges/release/dev16.2-to-master
Jul 25, 2019
37970b4
fixes issue #6832 (#7259)
KevinRansom Jul 25, 2019
8e843ae
[master] Update dependencies from dotnet/arcade (#7269)
dotnet-maestro[bot] Jul 26, 2019
b3811d2
Merge pull request #7279 from dotnet/merges/release/fsharp47-to-relea…
Jul 26, 2019
ce483c0
Update dependencies from https://github.com/dotnet/arcade build 20190…
dotnet-maestro[bot] Jul 26, 2019
969a9c4
Fix test assert (#7283)
KevinRansom Jul 26, 2019
2304ea4
merge
KevinRansom Jul 26, 2019
c03755f
disablewarningtests
KevinRansom Jul 27, 2019
d488458
Merge pull request #7266 from dotnet/merges/master-to-release/dev16.3
Jul 27, 2019
cc60ed6
code cleanup prior to optional interop improvements (#7276)
dsyme Jul 27, 2019
e72ded1
Update dependencies from https://github.com/dotnet/arcade build 20190…
dotnet-maestro[bot] Jul 27, 2019
bdb229c
Moving ClassesTests over to NUnit (#7264)
sergey-tihon Jul 27, 2019
8370ef6
Move Basic Constants to NUnit (#7262)
falfaddaghi Jul 27, 2019
3ce8eb1
Moved Don't Suggest Tests over to NUnit (#7288)
sergey-tihon Jul 29, 2019
868b76a
[master] Update dependencies from dotnet/arcade (#7287)
dotnet-maestro[bot] Jul 29, 2019
9c1a0d1
Fix langversion with multiple projects (#7293)
KevinRansom Jul 30, 2019
8edf449
Merge remote-tracking branch 'upstream/master' into merges/master-to-…
brettfo Jul 30, 2019
54f13f0
Merge pull request #7292 from dotnet/merges/master-to-release/dev16.3
Jul 30, 2019
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
Prev Previous commit
Next Next commit
Fix langversion with multiple projects (#7293)
  • Loading branch information
KevinRansom authored and TIHan committed Jul 30, 2019
commit 9c1a0d12bcdf114a9b1844ef194ea1e18f03c36e
1 change: 1 addition & 0 deletions src/fsharp/CompileOps.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ type TcConfig =
member copyFSharpCore: CopyFSharpCoreFlag
member shadowCopyReferences: bool
member useSdkRefs: bool
member langVersion: LanguageVersion

static member Create: TcConfigBuilder * validate: bool -> TcConfig

Expand Down
3 changes: 3 additions & 0 deletions src/fsharp/LanguageFeatures.fs
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,6 @@ type LanguageVersion (specifiedVersion) =
let label = if v = defaultVersion then " (Default)" else ""
yield sprintf "%M%s" v label
|]

/// Get the specified LanguageVersion
member __.SpecifiedVerson = specified
3 changes: 3 additions & 0 deletions src/fsharp/LanguageFeatures.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ type LanguageVersion =

/// Get the list of valid options
member ValidOptions: string array

/// Get the specified LanguageVersion
member SpecifiedVerson: decimal
13 changes: 7 additions & 6 deletions src/fsharp/service/IncrementalBuild.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ type TypeCheckAccumulator =


/// Global service state
type FrameworkImportsCacheKey = (*resolvedpath*)string list * string * (*TargetFrameworkDirectories*)string list* (*fsharpBinaries*)string
type FrameworkImportsCacheKey = (*resolvedpath*)string list * string * (*TargetFrameworkDirectories*)string list * (*fsharpBinaries*)string * (*langVersion*)decimal

/// Represents a cache of 'framework' references that can be shared betweeen multiple incremental builds
type FrameworkImportsCache(keepStrongly) =
Expand Down Expand Up @@ -1083,12 +1083,13 @@ type FrameworkImportsCache(keepStrongly) =
// The data elements in this key are very important. There should be nothing else in the TcConfig that logically affects
// the import of a set of framework DLLs into F# CCUs. That is, the F# CCUs that result from a set of DLLs (including
// FSharp.Core.dll and mscorlib.dll) must be logically invariant of all the other compiler configuration parameters.
let key = (frameworkDLLsKey,
tcConfig.primaryAssembly.Name,
tcConfig.GetTargetFrameworkDirectories(),
tcConfig.fsharpBinariesDir)
let key = (frameworkDLLsKey,
tcConfig.primaryAssembly.Name,
tcConfig.GetTargetFrameworkDirectories(),
tcConfig.fsharpBinariesDir,
tcConfig.langVersion.SpecifiedVerson)

match frameworkTcImportsCache.TryGet (ctok, key) with
match frameworkTcImportsCache.TryGet (ctok, key) with
| Some res -> return res
| None ->
let tcConfigP = TcConfigProvider.Constant tcConfig
Expand Down
173 changes: 173 additions & 0 deletions tests/fsharp/Compiler/Language/OpenStaticClasses.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.

namespace FSharp.Compiler.UnitTests

open FSharp.Compiler.SourceCodeServices
open NUnit.Framework


(*
Tests in this file evaluate whether the language supports accessing functions on static classes using open
The feature was added in FSharp4.7, the test cases ensure that the original errors are reproduced when the langversion:4.6 is specified
*)

[<TestFixture>]
module OpenStaticClassesTests =

let baseModule = """
module Core_OpenStaticClasses

[<AbstractClass; Sealed>]
type MyMath() =
static member Min(a: double, b: double) = System.Math.Min(a, b)
static member Min(a: int, b: int) = System.Math.Min(a, b)

[<AbstractClass; Sealed; AutoOpen>]
type AutoOpenMyMath() =
static member AutoMin(a: double, b: double) = System.Math.Min(a, b)
static member AutoMin(a: int, b: int) = System.Math.Min(a, b)

[<AbstractClass; Sealed; RequireQualifiedAccess>]
type NotAllowedToOpen() =
static member QualifiedMin(a: double, b: double) = System.Math.Min(a, b)
static member QualifiedMin(a: int, b: int) = System.Math.Min(a, b)

"""

[<Test>]
let ``OpenStaticClassesTests - OpenSystemMathOnce - langversion:v4.6`` () =
CompilerAssert.TypeCheckWithErrorsAndOptions
[| "--langversion:4.6" |]
(baseModule + """
module OpenSystemMathOnce =

open System.Math
let x = Min(1.0, 2.0)""")
[|
(FSharpErrorSeverity.Error, 39, (22,28,22,32), "The namespace 'Math' is not defined.");
(FSharpErrorSeverity.Error, 39, (23,24,23,27), "The value or constructor 'Min' is not defined.")
|]

[<Test>]
let ``OpenStaticClassesTests - OpenSystemMathOnce - langversion:v4.7`` () =
CompilerAssert.TypeCheckWithErrorsAndOptions
[| "--langversion:4.7" |]
(baseModule + """
module OpenSystemMathOnce =

open System.Math
let x = Min(1.0, 2.0)""")
[| |]

[<Test>]
let ``OpenStaticClassesTests - OpenSystemMathTwice - langversion:v4.6`` () =
CompilerAssert.TypeCheckWithErrorsAndOptions
[| "--langversion:4.6" |]
(baseModule + """
module OpenSystemMathTwice =

open System.Math
let x = Min(1.0, 2.0)

open System.Math
let x2 = Min(2.0, 1.0)""")
[|
(FSharpErrorSeverity.Error, 39, (22,17,22,21), "The namespace 'Math' is not defined.");
(FSharpErrorSeverity.Error, 39, (23,13,23,16), "The value or constructor 'Min' is not defined.")
(FSharpErrorSeverity.Error, 39, (25,17,25,21), "The namespace 'Math' is not defined.");
(FSharpErrorSeverity.Error, 39, (26,14,26,17), "The value or constructor 'Min' is not defined.")
|]

[<Test>]
let ``OpenStaticClassesTests - OpenSystemMathTwice - langversion:v4.7`` () =
CompilerAssert.TypeCheckWithErrorsAndOptions
[| "--langversion:4.7" |]
(baseModule + """
module OpenSystemMathOnce =

open System.Math
let x = Min(1.0, 2.0)""")
[| |]

[<Test>]
let ``OpenStaticClassesTests - OpenMyMathOnce - langversion:v4.6`` () =
CompilerAssert.TypeCheckWithErrorsAndOptions
[| "--langversion:4.6" |]
(baseModule + """
module OpenMyMathOnce =

open MyMath
let x = Min(1.0, 2.0)
let x2 = Min(1, 2)""")
[|
(FSharpErrorSeverity.Error, 39, (22,10,22,16), "The namespace or module 'MyMath' is not defined.");
(FSharpErrorSeverity.Error, 39, (23,13,23,16), "The value or constructor 'Min' is not defined.")
(FSharpErrorSeverity.Error, 39, (24,14,24,17), "The value or constructor 'Min' is not defined.")
|]

[<Test>]
let ``OpenStaticClassesTests - OpenMyMathOnce - langversion:v4.7`` () =
CompilerAssert.TypeCheckWithErrorsAndOptions
[| "--langversion:4.7" |]
(baseModule + """
module OpenMyMathOnce =

open MyMath
let x = Min(1.0, 2.0)
let x2 = Min(1, 2)""")
[| |]

[<Test>]
let ``OpenStaticClassesTests - DontOpenAutoMath - langversion:v4.6`` () =
CompilerAssert.TypeCheckWithErrorsAndOptions
[| "--langversion:4.6" |]
(baseModule + """
module DontOpenAutoMath =

let x = AutoMin(1.0, 2.0)
let x2 = AutoMin(1, 2)""")
[|
(FSharpErrorSeverity.Error, 39, (22,13,22,20), "The value or constructor 'AutoMin' is not defined.");
(FSharpErrorSeverity.Error, 39, (23,14,23,21), "The value or constructor 'AutoMin' is not defined.")
|]

[<Test>]
let ``OpenStaticClassesTests - DontOpenAutoMath - langversion:v4.7`` () =
CompilerAssert.TypeCheckWithErrorsAndOptions
[| "--langversion:4.7" |]
(baseModule + """
module DontOpenAutoMath =

let x = AutoMin(1.0, 2.0)
let x2 = AutoMin(1, 2)""")
[| |]

[<Test>]
let ``OpenStaticClassesTests - OpenAutoMath - langversion:v4.6`` () =
CompilerAssert.TypeCheckWithErrorsAndOptions
[| "--langversion:4.6" |]
(baseModule + """
module OpenAutoMath =
open AutoOpenMyMath
//open NotAllowedToOpen

let x = AutoMin(1.0, 2.0)
let x2 = AutoMin(1, 2)""")
[|
(FSharpErrorSeverity.Error, 39, (21,10,21,24), "The namespace or module 'AutoOpenMyMath' is not defined.");
(FSharpErrorSeverity.Error, 39, (24,13,24,20), "The value or constructor 'AutoMin' is not defined.")
(FSharpErrorSeverity.Error, 39, (25,14,25,21), "The value or constructor 'AutoMin' is not defined.")
|]

[<Test>]
let ``OpenStaticClassesTests - OpenAutoMath - langversion:v4.7`` () =
CompilerAssert.TypeCheckWithErrorsAndOptions
[| "--langversion:4.7" |]
(baseModule + """
module OpenAutoMath =
open AutoOpenMyMath
//open NotAllowedToOpen

let x = AutoMin(1.0, 2.0)
let x2 = AutoMin(1, 2)""")
[| |]
1 change: 1 addition & 0 deletions tests/fsharp/FSharpSuite.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<Compile Include="Compiler\ErrorMessages\WarnExpressionTests.fs" />
<Compile Include="Compiler\SourceTextTests.fs" />
<Compile Include="Compiler\Language\AnonRecordTests.fs" />
<Compile Include="Compiler\Language\OpenStaticClasses.fs" />
<Compile Include="Compiler\Language\SpanOptimizationTests.fs" />
<Compile Include="Compiler\Language\SpanTests.fs" />
<Compile Include="Compiler\Language\StringConcatOptimizationTests.fs" />
Expand Down
39 changes: 0 additions & 39 deletions tests/fsharp/core/longnames/version46/test.bsl

This file was deleted.

84 changes: 0 additions & 84 deletions tests/fsharp/core/longnames/version46/test.fs

This file was deleted.

Loading