Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
7b958fd
add a failing test exhibiting issue #8351
smoothdeveloper Jan 24, 2020
827e5b8
updating VB and F# code to have private getter as well, VB has same i…
smoothdeveloper Jan 24, 2020
b5e59d5
Furthering the test, all languages exhibit the same issue.
smoothdeveloper Jan 25, 2020
cccb3da
F# setter on Prop1 works, despite the getter is internal
smoothdeveloper Jan 25, 2020
5986427
fix for 8351 (/!\ may break other things)
smoothdeveloper Jan 25, 2020
b799113
reshuffle ILMemberAccess so plain comparison works
smoothdeveloper Jan 25, 2020
8f94aff
testConfig has a new version
smoothdeveloper Jun 10, 2020
399f059
Allow implementing the same interface at different generic instantiat…
0x53A Jun 11, 2020
b5f5f6a
adding basic test around ILMemberAccess items being comparable to eac…
smoothdeveloper Jun 12, 2020
1ccb4b1
ceci n'est pas une fonction factorielle
smoothdeveloper Jun 12, 2020
b024d51
codereview: redefine order of ILMemberAccess to match roslyn codebase
smoothdeveloper Jun 12, 2020
790821b
updates
KevinRansom Jun 12, 2020
7e19f47
Feedback + fsharpqa
KevinRansom Jun 12, 2020
c18eae1
feedback
KevinRansom Jun 13, 2020
b88ba3c
Update for fix8351
KevinRansom Jun 15, 2020
501fc64
Merge branch 'master' of https://github.com/dotnet/fsharp into so-man…
dsyme Jun 15, 2020
2b6a416
simplifications to code
dsyme Jun 15, 2020
c5345f8
try simplify type logic
dsyme Jun 15, 2020
1baa001
try simplify type logic
dsyme Jun 15, 2020
49d99be
feedback
KevinRansom Jun 16, 2020
83097de
Merge branch 'master' of https://github.com/dotnet/fsharp into featur…
dsyme Jun 16, 2020
90f1d07
moar tests
KevinRansom Jun 18, 2020
e324477
dim tests
KevinRansom Jun 19, 2020
2feab1d
Update InterfaceTests.fs
KevinRansom Jun 19, 2020
2a19650
Merge branch 'master' of https://github.com/dotnet/fsharp into so-man…
KevinRansom Jun 20, 2020
e2703e3
Get namespace right
KevinRansom Jun 20, 2020
fb3c52b
Update src/fsharp/AccessibilityLogic.fs
KevinRansom Jun 20, 2020
16deb23
resolve conflicts
KevinRansom Jun 20, 2020
37be39e
merge
KevinRansom Jun 20, 2020
24b4d28
Update
smoothdeveloper Jun 22, 2020
26d7cc5
Update language version status of some features (#9507)
KevinRansom Jun 23, 2020
3a067f4
Consolidate Compiler ErrorMessage tests under one suite. (#9525)
vzarytovskii Jun 23, 2020
403f594
Merge pull request #9543 from dotnet/merges/master-to-release/dev16.7
KevinRansom Jun 23, 2020
fbed3a9
Merge branch 'master' into so-many-interfaces
KevinRansom Jun 23, 2020
8bfcdd6
Merge branch 'master' into fix-for-issue-8351
KevinRansom Jun 23, 2020
4456e0a
Better classification: such colors, much wow (#9511)
cartermp Jun 23, 2020
1ecc201
Merge pull request #8354 from smoothdeveloper/fix-for-issue-8351
KevinRansom Jun 23, 2020
6e50f75
Merge pull request #9550 from dotnet/merges/master-to-release/dev16.7
KevinRansom Jun 24, 2020
c479cde
Update FSComp.txt (#9556)
cartermp Jun 24, 2020
2f202ef
Merge pull request #9559 from dotnet/merges/master-to-release/dev16.7
KevinRansom Jun 24, 2020
5f8a77b
Syntax tree: include modifiers to binding ranges (#9541)
auduchinok Jun 24, 2020
cff1922
Merge pull request #9562 from dotnet/merges/master-to-release/dev16.7
KevinRansom Jun 25, 2020
79c9702
Update xlf (#9567)
KevinRansom Jun 25, 2020
d34dab9
Merge pull request #9568 from dotnet/merges/master-to-release/dev16.7
KevinRansom Jun 26, 2020
70f3758
Moved fsharpqa/Libraries/Core/Operators test cases to NUnit (#9570)
ThorstenReichert Jun 26, 2020
42f26f2
Merge pull request #9572 from dotnet/merges/master-to-release/dev16.7
KevinRansom Jun 26, 2020
5dd9268
Merge branch 'master' into so-many-interfaces
KevinRansom Jun 26, 2020
6f3d196
Merge master
KevinRansom Jun 26, 2020
7896b6c
temp
KevinRansom Jun 26, 2020
8701c47
merge
KevinRansom Jun 26, 2020
a166922
Update dependencies from https://github.com/dotnet/arcade build 20200…
dotnet-maestro[bot] Jun 27, 2020
7b29d44
Improve perf for String.filter up to 3x (#9509)
abelbraaksma Jun 27, 2020
35e2caa
String map performance improvement (#9470)
abelbraaksma Jun 27, 2020
de5dc3b
Perf: String.replicate from O(n) to O(log(n)), up to 12x speed improv…
abelbraaksma Jun 27, 2020
b74c9de
Merge master to release/dev16.7 (#9578)
dotnet-bot Jun 27, 2020
97778cb
Re enable tests for operators: OperatorsModule1.fs and OperatorsModul…
abelbraaksma Jun 28, 2020
bab2902
Merge pull request #9582 from dotnet/merges/master-to-release/dev16.7
KevinRansom Jun 28, 2020
34df7e4
Complification, the recent simplification did not flow measures / era…
KevinRansom Jun 28, 2020
2cd49dc
Re enable tests for operators: OperatorsModule1.fs and OperatorsModul…
dotnet-bot Jun 29, 2020
0b5f732
more testing
KevinRansom Jun 29, 2020
b2f3aa1
Re enable tests for operators: OperatorsModule1.fs and OperatorsModul…
dotnet-bot Jun 29, 2020
4bfe004
more tests
KevinRansom Jun 29, 2020
19c9e2f
Merge pull request #9593 from dotnet/merges/master-to-release/dev16.7
KevinRansom Jun 29, 2020
4ed1c51
merge
KevinRansom Jun 29, 2020
b4e7147
Moved fsharpqa/Libraries/Core/Unchecked test cases to NUnit (#9576)
ThorstenReichert Jun 29, 2020
bd8721f
Moved fsharpqa/Libraries/Core/Reflectiontest cases to NUnit (#9611)
ThorstenReichert Jul 3, 2020
da84a19
Allow notebook to discover location of shared framework (#9596)
KevinRansom Jul 3, 2020
62fb769
Fix tests
KevinRansom Jul 3, 2020
4bf4ba3
Merge branch 'so-many-interfaces' of https://github.com/0x53A/visualf…
KevinRansom Jul 6, 2020
b2e8dc2
feedback
KevinRansom Jul 6, 2020
539ea96
Moved fsharpqa/Conformance/BasicGrammarElements/Constants test cases …
ThorstenReichert Jul 6, 2020
5a5f8bd
Cleanup, remove fsproj lines that are now redundant (#9628)
abelbraaksma Jul 6, 2020
f71e5b6
Update LanguageFeatures.fs
KevinRansom Jul 6, 2020
e57d036
Update LanguageFeatures.fs
KevinRansom Jul 6, 2020
687fa0a
alternative fix for 9565 (#9629)
dsyme Jul 6, 2020
31a9ba7
Warn on invalided FSI directives. (#9601)
KevinRansom Jul 6, 2020
a8d7981
Merge branch 'master' into so-many-interfaces
KevinRansom Jul 6, 2020
fcba42e
revert baselines
KevinRansom Jul 6, 2020
cc13c26
Merge branch 'so-many-interfaces' of https://github.com/0x53A/visualf…
KevinRansom Jul 6, 2020
636052a
Merge pull request #2867 from 0x53A/so-many-interfaces
KevinRansom Jul 6, 2020
3e6cf8b
Add launchSettings.json to ignore list (#9638)
gusty Jul 7, 2020
a8d3280
clarify some comments
brettfo Jul 7, 2020
8077622
make xliff tasks happy again (#9641)
brettfo Jul 7, 2020
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ scripts/*.patch
/src/fsharp/FSharp.LanguageService.Compiler/pplex.fs
/src/fsharp/FSharp.LanguageService.Compiler/pppars.fs
/src/fsharp/FSharp.LanguageService.Compiler/pppars.fsi
/src/fsharp/*/Properties/launchSettings.json
/vsintegration/src/unittests/Unittests.fsi
/tests/*FSharp_Failures.env
/tests/*FSharp_Failures.lst
Expand Down
61 changes: 52 additions & 9 deletions src/fsharp/AccessibilityLogic.fs
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,53 @@ let private IsILMethInfoAccessible g amap m adType ad ilminfo =
let GetILAccessOfILPropInfo (ILPropInfo(tinfo, pdef)) =
let tdef = tinfo.RawMetadata
let ilAccess =
match pdef.GetMethod with
| Some mref -> (resolveILMethodRef tdef mref).Access
| None ->
match pdef.SetMethod with
| None -> ILMemberAccess.Public
| Some mref -> (resolveILMethodRef tdef mref).Access
match pdef.GetMethod, pdef.SetMethod with
| Some mref, None
| None, Some mref -> (resolveILMethodRef tdef mref).Access

| Some mrefGet, Some mrefSet ->
//
// Dotnet properties have a getter and a setter method, each of which can have a separate visibility public, protected, private etc ...
// This code computes the visibility for the property by choosing the most visible method. This approximation is usefull for cases
// where the compiler needs to know the visibility of the property.
// The specific ordering for choosing the most visible is:
// ILMemberAccess.Public,
// ILMemberAccess.FamilyOrAssembly
// ILMemberAccess.Assembly
// ILMemberAccess.Family
// ILMemberAccess.FamilyAndAssembly
// ILMemberAccess.Private
// ILMemberAccess.CompilerControlled
//
let getA = (resolveILMethodRef tdef mrefGet).Access
let setA = (resolveILMethodRef tdef mrefSet).Access

// Use the accessors to determine the visibility of the property.
// N.B. It is critical to keep the ordering in decreasing visibility order in the following match expression
match getA, setA with
| ILMemberAccess.Public, _
| _, ILMemberAccess.Public -> ILMemberAccess.Public

| ILMemberAccess.FamilyOrAssembly, _
| _, ILMemberAccess.FamilyOrAssembly -> ILMemberAccess.FamilyOrAssembly

| ILMemberAccess.Assembly, _
| _, ILMemberAccess.Assembly -> ILMemberAccess.Assembly

| ILMemberAccess.Family, _
| _, ILMemberAccess.Family -> ILMemberAccess.Family

| ILMemberAccess.FamilyAndAssembly, _
| _, ILMemberAccess.FamilyAndAssembly -> ILMemberAccess.FamilyAndAssembly

| ILMemberAccess.Private, _
| _, ILMemberAccess.Private -> ILMemberAccess.Private

| ILMemberAccess.CompilerControlled, _
| _, ILMemberAccess.CompilerControlled -> ILMemberAccess.CompilerControlled

| None, None -> ILMemberAccess.Public

ilAccess

let IsILPropInfoAccessible g amap m ad pinfo =
Expand Down Expand Up @@ -323,8 +364,11 @@ let IsMethInfoAccessible amap m ad minfo = IsTypeAndMethInfoAccessible amap m ad

let IsPropInfoAccessible g amap m ad = function
| ILProp ilpinfo -> IsILPropInfoAccessible g amap m ad ilpinfo
| FSProp (_, _, Some vref, _)
| FSProp (_, _, _, Some vref) -> IsValAccessible ad vref
| FSProp (_, _, Some vref, None)
| FSProp (_, _, None, Some vref) -> IsValAccessible ad vref
| FSProp (_, _, Some vrefGet, Some vrefSet) ->
// pick most accessible
IsValAccessible ad vrefGet || IsValAccessible ad vrefSet
#if !NO_EXTENSIONTYPING
| ProvidedProp (amap, tppi, m) as pp->
let access =
Expand All @@ -343,4 +387,3 @@ let IsPropInfoAccessible g amap m ad = function

let IsFieldInfoAccessible ad (rfref:RecdFieldInfo) =
IsAccessible ad rfref.RecdField.Accessibility

19 changes: 14 additions & 5 deletions src/fsharp/ErrorLogger.fs
Original file line number Diff line number Diff line change
Expand Up @@ -677,15 +677,24 @@ type public FSharpErrorSeverityOptions =
// let dummyMethodFOrBug6417A() = ()
// let dummyMethodFOrBug6417B() = ()

let private tryLanguageFeatureErrorAux (langVersion: LanguageVersion) (langFeature: LanguageFeature) (m: range) error =
if not (langVersion.SupportsFeature langFeature) then
let private tryLanguageFeatureErrorAux (langVersion: LanguageVersion) (langFeature: LanguageFeature) (m: range) =
if not (langVersion.SupportsFeature langFeature) then
let featureStr = langVersion.GetFeatureString langFeature
let currentVersionStr = langVersion.SpecifiedVersionString
let suggestedVersionStr = langVersion.GetFeatureVersionString langFeature
error (Error(FSComp.SR.chkFeatureNotLanguageSupported(featureStr, currentVersionStr, suggestedVersionStr), m))
Some (Error(FSComp.SR.chkFeatureNotLanguageSupported(featureStr, currentVersionStr, suggestedVersionStr), m))
else
None

let internal tryLanguageFeatureError langVersion langFeature m =
tryLanguageFeatureErrorAux langVersion langFeature m error
match tryLanguageFeatureErrorAux langVersion langFeature m with
| Some e -> error (e)
| None -> ()

let internal tryLanguageFeatureErrorRecover langVersion langFeature m =
tryLanguageFeatureErrorAux langVersion langFeature m errorR
match tryLanguageFeatureErrorAux langVersion langFeature m with
| Some e -> errorR e
| None -> ()

let internal tryLanguageFeatureErrorOption langVersion langFeature m =
tryLanguageFeatureErrorAux langVersion langFeature m
6 changes: 5 additions & 1 deletion src/fsharp/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1512,4 +1512,8 @@ featureFixedIndexSlice3d4d,"fixed-index slice 3d/4d"
featureAndBang,"applicative computation expressions"
featureNullableOptionalInterop,"nullable optional interop"
featureDefaultInterfaceMemberConsumption,"default interface member consumption"
featureWitnessPassing,"witness passing"
featureWitnessPassing,"witness passing for trait constraints in F# quotations"
3353,fsiInvalidDirective,"Invalid directive '#%s %s'"
3360,typrelInterfaceWithConcreteAndVariable,"'%s' cannot implement the interface '%s' with the two instantiations '%s' and '%s' because they may unify."
3361,typrelInterfaceWithConcreteAndVariableObjectExpression,"You cannot implement the interface '%s' with the two instantiations '%s' and '%s' because they may unify."
featureInterfacesWithMultipleGenericInstantiation,"interfaces with multiple generic instantiation"
73 changes: 62 additions & 11 deletions src/fsharp/FSharp.Core/string.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ namespace Microsoft.FSharp.Core
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
[<RequireQualifiedAccess>]
module String =
[<Literal>]
/// LOH threshold is calculated from FSharp.Compiler.AbstractIL.Internal.Library.LOH_SIZE_THRESHOLD_BYTES,
/// and is equal to 80_000 / sizeof<char>
let LOH_CHAR_THRESHOLD = 40_000

[<CompiledName("Length")>]
let length (str:string) = if isNull str then 0 else str.Length

Expand All @@ -37,9 +42,13 @@ namespace Microsoft.FSharp.Core
if String.IsNullOrEmpty str then
String.Empty
else
let res = StringBuilder str.Length
str |> iter (fun c -> res.Append(mapping c) |> ignore)
res.ToString()
let result = str.ToCharArray()
let mutable i = 0
for c in result do
result.[i] <- mapping c
i <- i + 1

new String(result)

[<CompiledName("MapIndexed")>]
let mapi (mapping: int -> char -> char) (str:string) =
Expand All @@ -53,13 +62,30 @@ namespace Microsoft.FSharp.Core

[<CompiledName("Filter")>]
let filter (predicate: char -> bool) (str:string) =
if String.IsNullOrEmpty str then
let len = length str

if len = 0 then
String.Empty
else
let res = StringBuilder str.Length

elif len > LOH_CHAR_THRESHOLD then
// By using SB here, which is twice slower than the optimized path, we prevent LOH allocations
// and 'stop the world' collections if the filtering results in smaller strings.
// We also don't pre-allocate SB here, to allow for less mem pressure when filter result is small.
let res = StringBuilder()
str |> iter (fun c -> if predicate c then res.Append c |> ignore)
res.ToString()

else
// Must do it this way, since array.fs is not yet in scope, but this is safe
let target = Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked len
let mutable i = 0
for c in str do
if predicate c then
target.[i] <- c
i <- i + 1

String(target, 0, i)

[<CompiledName("Collect")>]
let collect (mapping: char -> string) (str:string) =
if String.IsNullOrEmpty str then
Expand All @@ -81,13 +107,38 @@ namespace Microsoft.FSharp.Core
let replicate (count:int) (str:string) =
if count < 0 then invalidArgInputMustBeNonNegative "count" count

if String.IsNullOrEmpty str then
let len = length str
if len = 0 || count = 0 then
String.Empty

elif len = 1 then
new String(str.[0], count)

elif count <= 4 then
match count with
| 1 -> str
| 2 -> String.Concat(str, str)
| 3 -> String.Concat(str, str, str)
| _ -> String.Concat(str, str, str, str)

else
let res = StringBuilder(count * str.Length)
for i = 0 to count - 1 do
res.Append str |> ignore
res.ToString()
// Using the primitive, because array.fs is not yet in scope. It's safe: both len and count are positive.
let target = Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked (len * count)
let source = str.ToCharArray()

// O(log(n)) performance loop:
// Copy first string, then keep copying what we already copied
// (i.e., doubling it) until we reach or pass the halfway point
Array.Copy(source, 0, target, 0, len)
let mutable i = len
while i * 2 < target.Length do
Array.Copy(target, 0, target, i, i)
i <- i * 2

// finally, copy the remain half, or less-then half
Array.Copy(target, 0, target, i, target.Length - i)
new String(target)


[<CompiledName("ForAll")>]
let forall predicate (str:string) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ module internal Utilities =
| value when not (String.IsNullOrEmpty(value)) ->
Some value // Value set externally
| _ ->
// Probe for netsdk install
// Probe for netsdk install, dotnet. and dotnet.exe is a constant offset from the location of System.Int32
let dotnetLocation =
let dotnetApp =
let platform = Environment.OSVersion.Platform
if platform = PlatformID.Unix then "dotnet" else "dotnet.exe"
let assemblyLocation = typeof<DependencyManagerAttribute>.GetTypeInfo().Assembly.Location
let assemblyLocation = typeof<Int32>.GetTypeInfo().Assembly.Location
Path.Combine(assemblyLocation, "../../..", dotnetApp)

if File.Exists(dotnetLocation) then
Expand Down
6 changes: 4 additions & 2 deletions src/fsharp/IlxGen.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4298,8 +4298,10 @@ and GenActualSlotsig m cenv eenv (TSlotSig(_, ty, ctps, mtps, ilSlotParams, ilSl

and GenNameOfOverridingMethod cenv (useMethodImpl, slotsig) =
let (TSlotSig(nameOfOverridenMethod, enclTypOfOverridenMethod, _, _, _, _)) = slotsig
if useMethodImpl then qualifiedMangledNameOfTyconRef (tcrefOfAppTy cenv.g enclTypOfOverridenMethod) nameOfOverridenMethod
else nameOfOverridenMethod
if useMethodImpl then
qualifiedInterfaceImplementationName cenv.g enclTypOfOverridenMethod nameOfOverridenMethod
else
nameOfOverridenMethod

and GenMethodImpl cenv eenv (useMethodImpl, (TSlotSig(nameOfOverridenMethod, _, _, _, _, _) as slotsig)) m =
let ilOverrideTy, ilOverrideParams, ilOverrideRet = GenFormalSlotsig m cenv eenv slotsig
Expand Down
19 changes: 11 additions & 8 deletions src/fsharp/LanguageFeatures.fs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type LanguageFeature =
| NullableOptionalInterop
| DefaultInterfaceMemberConsumption
| WitnessPassing
| InterfacesWithMultipleGenericInstantiation

/// LanguageVersion management
type LanguageVersion (specifiedVersionAsString) =
Expand All @@ -41,12 +42,12 @@ type LanguageVersion (specifiedVersionAsString) =
static let languageVersion47 = 4.7m
static let languageVersion50 = 5.0m
static let previewVersion = 9999m // Language version when preview specified
static let defaultVersion = languageVersion50 // Language version when default specified
static let defaultVersion = languageVersion47 // Language version when default specified
static let latestVersion = defaultVersion // Language version when latest specified
static let latestMajorVersion = languageVersion47 // Language version when latestmajor specified

static let validOptions = [| "preview"; "default"; "latest"; "latestmajor" |]
static let languageVersions = set [| languageVersion46; languageVersion47; languageVersion50 |]
static let languageVersions = set [| languageVersion46; languageVersion47 ; languageVersion50 |]

static let features =
dict [
Expand All @@ -58,17 +59,18 @@ type LanguageVersion (specifiedVersionAsString) =

// F# 5.0
LanguageFeature.FixedIndexSlice3d4d, languageVersion50
LanguageFeature.FromEndSlicing, languageVersion50
LanguageFeature.DotlessFloat32Literal, languageVersion50
LanguageFeature.AndBang, languageVersion50
LanguageFeature.NullableOptionalInterop, languageVersion50
LanguageFeature.DefaultInterfaceMemberConsumption, languageVersion50

// F# preview
LanguageFeature.NameOf, previewVersion
LanguageFeature.FromEndSlicing, previewVersion
LanguageFeature.OpenStaticClasses, previewVersion
LanguageFeature.PackageManagement, previewVersion
LanguageFeature.AndBang, previewVersion
LanguageFeature.NullableOptionalInterop, previewVersion
LanguageFeature.DefaultInterfaceMemberConsumption, previewVersion
LanguageFeature.WitnessPassing, previewVersion
LanguageFeature.InterfacesWithMultipleGenericInstantiation, previewVersion
LanguageFeature.NameOf, previewVersion
]

let specified =
Expand All @@ -80,7 +82,7 @@ type LanguageVersion (specifiedVersionAsString) =
| "latestmajor" -> latestMajorVersion
| "4.6" -> languageVersion46
| "4.7" -> languageVersion47
(* | "5.0" -> languageVersion50 *)
| "5.0" -> languageVersion50
| _ -> 0m

let versionToString v =
Expand Down Expand Up @@ -138,6 +140,7 @@ type LanguageVersion (specifiedVersionAsString) =
| LanguageFeature.NullableOptionalInterop -> FSComp.SR.featureNullableOptionalInterop()
| LanguageFeature.DefaultInterfaceMemberConsumption -> FSComp.SR.featureDefaultInterfaceMemberConsumption()
| LanguageFeature.WitnessPassing -> FSComp.SR.featureWitnessPassing()
| LanguageFeature.InterfacesWithMultipleGenericInstantiation -> FSComp.SR.featureInterfacesWithMultipleGenericInstantiation()

/// Get a version string associated with the given feature.
member _.GetFeatureVersionString feature =
Expand Down
1 change: 1 addition & 0 deletions src/fsharp/LanguageFeatures.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type LanguageFeature =
| NullableOptionalInterop
| DefaultInterfaceMemberConsumption
| WitnessPassing
| InterfacesWithMultipleGenericInstantiation

/// LanguageVersion management
type LanguageVersion =
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/LexFilter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ type LexFilterImpl (lightSyntaxStatus: LightSyntaxStatus, compilingFsLib, lexer,
// a TYPE or MODULE. So the lexfilter helps out by looking ahead for these tokens and (1) closing expression contexts and (2) inserting extra 'coming soon' tokens
// that the expression rules in the FsYacc parser can 'shift' to make progress parsing the incomplete expressions, without using the 'recover' action.
let insertComingSoonTokens(keywordName, comingSoon, isHere) =
// compiling the source for FSharp.Core.dll uses crazy syntax like
// compiling the source for FSharp.Core.dll uses unconventional syntax like
// (# "unbox.any !0" type ('T) x : 'T #)
// where the type keyword is used inside an expression, so we must exempt FSharp.Core from some extra failed-parse-diagnostics-recovery-processing of the 'type' keyword
let mutable effectsToDo = []
Expand Down
11 changes: 10 additions & 1 deletion src/fsharp/MethodCalls.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,15 @@ let AdjustCallerArgForOptional tcFieldInit eCallerMemberName (infoReader: InfoRe
if isOptCallerArg then errorR(Error(FSComp.SR.tcFormalArgumentIsNotOptional(), m))
assignedArg

// For non-nullable, non-optional arguments no conversion is needed.
// We return precisely the assignedArg. This also covers the case where there
// can be a lingering permitted type mismatch between caller argument and called argument,
// specifically caller can by `byref` and called `outref`. No coercion is inserted in the
// expression tree in this case.
| NotOptional when not (isNullableTy g calledArgTy) ->
if isOptCallerArg then errorR(Error(FSComp.SR.tcFormalArgumentIsNotOptional(), m))
assignedArg

| _ ->

let callerArgExpr2 =
Expand All @@ -1183,7 +1192,7 @@ let AdjustCallerArgForOptional tcFieldInit eCallerMemberName (infoReader: InfoRe
if isNullableTy g calledArgTy then
MakeNullableExprIfNeeded infoReader calledArgTy callerArgTy callerArgExpr m
else
callerArgExpr
failwith "unreachable" // see case above

| CallerSide dfltVal ->
let calledArgTy = calledArg.CalledArgumentType
Expand Down
Loading