Skip to content

Commit 696e00b

Browse files
committed
Fix 823
1 parent fd22b7e commit 696e00b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/fsharp/TypeChecker.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8249,16 +8249,16 @@ and TcItemThen cenv overallTy env tpenv (item,mItem,rest,afterOverloadResolution
82498249
else error(Error(FSComp.SR.tcUnionCaseFieldCannotBeUsedMoreThanOnce(id.idText), id.idRange))
82508250
currentIndex <- SEEN_NAMED_ARGUMENT
82518251
| None ->
8252-
// ambiguity may apprear only when if argument is boolean\generic.
8252+
// ambiguity may appear only when if argument is boolean\generic.
82538253
// if
82548254
// - we didn't find argument with specified name AND
82558255
// - we have not seen any named arguments so far AND
82568256
// - type of current argument is bool\generic
82578257
// then we'll favor old behavior and treat current argument as positional.
82588258
let isSpecialCaseForBackwardCompatibility =
8259-
if currentIndex = SEEN_NAMED_ARGUMENT then false
8260-
else
8261-
match stripTyEqns cenv.g (List.item currentIndex argtys) with
8259+
(currentIndex <> SEEN_NAMED_ARGUMENT) &&
8260+
(currentIndex < nargtys) &&
8261+
match stripTyEqns cenv.g argtys.[currentIndex] with
82628262
| TType_app(tcref, _) -> tyconRefEq cenv.g cenv.g.bool_tcr tcref || tyconRefEq cenv.g cenv.g.system_Bool_tcref tcref
82638263
| TType_var(_) -> true
82648264
| _ -> false

tests/fsharp/core/libtest/test.fsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5662,6 +5662,10 @@ module Regression_139182 =
56625662
static member Prop4 = str.ToLower() // ok
56635663
member x.Prop5 = s2.TheMethod() // ok
56645664

5665+
module LittleTestFor823 =
5666+
let x, y = 1, 2
5667+
let v = Some (x = y, x = x)
5668+
56655669
(*---------------------------------------------------------------------------
56665670
!* wrap up
56675671
*--------------------------------------------------------------------------- *)

0 commit comments

Comments
 (0)