Skip to content

Commit

Permalink
Added List.fold to complete the fix (?).
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottHutchinson committed Aug 20, 2018
1 parent d0713da commit 467f529
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/fsharp/TypeChecker.fs
Original file line number Diff line number Diff line change
Expand Up @@ -15690,9 +15690,10 @@ module EstablishTypeDefinitionCores =
and accStructFieldType structTycon structTyInst fspec fieldTy (doneTypes, acc) =
let fieldTy = stripTyparEqns fieldTy
match fieldTy with
| TType_tuple (_isStruct , t2) when isStructTupleTy cenv.g fieldTy ->
// The field is a struct tuple. Decapitate and repeat.
accStructFieldType structTycon structTyInst fspec (List.head t2) (doneTypes, acc)
| TType_tuple (_isStruct , tinst2) when isStructTupleTy cenv.g fieldTy ->
// The field is a struct tuple. Check each element of the tuple.
// This case was added to resolve https://github.com/Microsoft/visualfsharp/issues/3916
tinst2 |> List.fold (fun acc' x -> accStructFieldType structTycon structTyInst fspec x acc') (doneTypes, acc)
| TType_app (tcref2 , tinst2) when tcref2.IsStructOrEnumTycon ->
// The field is a struct.
// An edge (tycon, tycon2) should be recorded, unless it is the "static self-typed field" case.
Expand Down

0 comments on commit 467f529

Please sign in to comment.