@@ -12394,16 +12394,16 @@ module TcRecdUnionAndEnumDeclarations = begin
1239412394 let ValidateFieldNames (synFields: SynField list, tastFields: RecdField list) =
1239512395 let seen = Dictionary()
1239612396 for (sf, f) in List.zip synFields tastFields do
12397- let mutable synField = Unchecked.defaultof<_>
12398- if seen.TryGetValue(f.Name, & synField) then
12397+ match seen.TryGetValue(f.Name) with
12398+ | true, synField ->
1239912399 match sf, synField with
1240012400 | Field(_, _, Some id, _, _, _, _, _), Field(_, _, Some(_), _, _, _, _, _) ->
1240112401 error(Error(FSComp.SR.tcFieldNameIsUsedModeThanOnce(id.idText), id.idRange))
1240212402 | Field(_, _, Some id, _, _, _, _, _), Field(_, _, None, _, _, _, _, _)
1240312403 | Field(_, _, None, _, _, _, _, _), Field(_, _, Some id, _, _, _, _, _) ->
1240412404 error(Error(FSComp.SR.tcFieldNameConflictsWithGeneratedNameForAnonymousField(id.idText), id.idRange))
1240512405 | _ -> assert false
12406- else
12406+ | _ ->
1240712407 seen.Add(f.Name, sf)
1240812408
1240912409 let TcUnionCaseDecl cenv env parent thisTy tpenv (UnionCase (synAttrs, id, args, xmldoc, vis, m)) =
0 commit comments