@@ -455,7 +455,7 @@ module TcRecdUnionAndEnumDeclarations =
455455 let ValidateFieldNames ( synFields : SynField list , tastFields : RecdField list ) =
456456 let seen = Dictionary()
457457 ( synFields, tastFields) ||> List.iter2 ( fun sf f ->
458- match seen.TryGetValue f.Name with
458+ match seen.TryGetValue f.LogicalName with
459459 | true , synField ->
460460 match sf, synField with
461461 | SynField(_, _, Some id, _, _, _, _, _), SynField(_, _, Some _, _, _, _, _, _) ->
@@ -465,7 +465,7 @@ module TcRecdUnionAndEnumDeclarations =
465465 error( Error( FSComp.SR.tcFieldNameConflictsWithGeneratedNameForAnonymousField( id.idText), id.idRange))
466466 | _ -> assert false
467467 | _ ->
468- seen.Add( f.Name , sf))
468+ seen.Add( f.LogicalName , sf))
469469
470470 let TcUnionCaseDecl cenv env parent thisTy thisTyInst tpenv ( SynUnionCase ( Attributes synAttrs , id , args , xmldoc , vis , m )) =
471471 let attrs = TcAttributes cenv env AttributeTargets.UnionCaseDecl synAttrs // the attributes of a union case decl get attached to the generated "static factory" method
@@ -503,7 +503,7 @@ module TcRecdUnionAndEnumDeclarations =
503503 if not ( typeEquiv cenv.g recordTy thisTy) then
504504 error( Error( FSComp.SR.tcReturnTypesForUnionMustBeSameAsType(), m))
505505 rfields, recordTy
506- let names = rfields |> List.map ( fun f -> f.Name )
506+ let names = rfields |> List.map ( fun f -> f.DisplayNameCore )
507507 let doc = xmldoc.ToXmlDoc( true , Some names)
508508 Construct.NewUnionCase id rfields recordTy attrs doc vis
509509
@@ -1379,7 +1379,7 @@ module IncrClassChecking =
13791379 [ for b in memberBinds do
13801380 yield b.Var.CompiledName cenv.g.CompilerGlobalState
13811381 yield b.Var.DisplayName
1382- yield b.Var.CoreDisplayName
1382+ yield b.Var.DisplayNameCoreMangled
13831383 yield b.Var.LogicalName ]
13841384 let reps = IncrClassReprInfo.Empty( g, takenFieldNames)
13851385
@@ -2040,7 +2040,7 @@ module MutRecBindingChecking =
20402040
20412041 if needsSafeStaticInit && hasStaticBindings then
20422042 let rfield = MakeSafeInitField g envForDecls tcref.Range true
2043- SafeInitField( mkRecdFieldRef tcref rfield.Name , rfield)
2043+ SafeInitField( mkRecdFieldRef tcref rfield.LogicalName , rfield)
20442044 else
20452045 NoSafeInitInfo
20462046
@@ -3147,7 +3147,7 @@ module EstablishTypeDefinitionCores =
31473147 if InstanceMembersNeedSafeInitCheck cenv m thisTy then
31483148 let rfield = MakeSafeInitField cenv.g env m false
31493149 let tcref = tcrefOfAppTy cenv.g thisTy
3150- SafeInitField ( mkRecdFieldRef tcref rfield.Name , rfield)
3150+ SafeInitField ( mkRecdFieldRef tcref rfield.LogicalName , rfield)
31513151 else
31523152 NoSafeInitInfo
31533153
@@ -3321,7 +3321,7 @@ module EstablishTypeDefinitionCores =
33213321 if not inSig && not hasMeasureAttr then
33223322 errorR( Error( FSComp.SR.tcTypeRequiresDefinition(), m))
33233323 if hasMeasureAttr then
3324- TFSharpObjectRepr { fsobjmodel_ kind = TTyconClass
3324+ TFSharpObjectRepr { fsobjmodel_ kind = TFSharpClass
33253325 fsobjmodel_ vslots = []
33263326 fsobjmodel_ rfields = Construct.MakeRecdFieldsTable [] }
33273327 else
@@ -3353,7 +3353,7 @@ module EstablishTypeDefinitionCores =
33533353 InferTyconKind cenv.g ( SynTypeDefnKind.Record, attrs, [], [], inSig, true , m) |> ignore
33543354
33553355 // Note: the table of record fields is initially empty
3356- TRecdRepr ( Construct.MakeRecdFieldsTable [])
3356+ TFSharpRecdRepr ( Construct.MakeRecdFieldsTable [])
33573357
33583358 | SynTypeDefnSimpleRepr.General ( kind, _, slotsigs, fields, isConcrete, _, _, _) ->
33593359 let kind = InferTyconKind cenv.g ( kind, attrs, slotsigs, fields, inSig, isConcrete, m)
@@ -3363,10 +3363,10 @@ module EstablishTypeDefinitionCores =
33633363 | _ ->
33643364 let kind =
33653365 match kind with
3366- | SynTypeDefnKind.Class -> TTyconClass
3367- | SynTypeDefnKind.Interface -> TTyconInterface
3368- | SynTypeDefnKind.Delegate _ -> TTyconDelegate ( MakeSlotSig( " Invoke" , cenv.g.unit_ ty, [], [], [], None))
3369- | SynTypeDefnKind.Struct -> TTyconStruct
3366+ | SynTypeDefnKind.Class -> TFSharpClass
3367+ | SynTypeDefnKind.Interface -> TFSharpInterface
3368+ | SynTypeDefnKind.Delegate _ -> TFSharpDelegate ( MakeSlotSig( " Invoke" , cenv.g.unit_ ty, [], [], [], None))
3369+ | SynTypeDefnKind.Struct -> TFSharpStruct
33703370 | _ -> error( InternalError( " should have inferred tycon kind" , m))
33713371
33723372 let repr =
@@ -3377,7 +3377,7 @@ module EstablishTypeDefinitionCores =
33773377 TFSharpObjectRepr repr
33783378
33793379 | SynTypeDefnSimpleRepr.Enum _ ->
3380- let kind = TTyconEnum
3380+ let kind = TFSharpEnum
33813381 let repr =
33823382 { fsobjmodel_ kind = kind
33833383 fsobjmodel_ vslots = []
@@ -3413,7 +3413,7 @@ module EstablishTypeDefinitionCores =
34133413
34143414 let typeBeforeArguments =
34153415 match tcrefBeforeStaticArguments.TypeReprInfo with
3416- | TProvidedTypeExtensionPoint info -> info.ProvidedType
3416+ | TProvidedTypeRepr info -> info.ProvidedType
34173417 | _ -> failwith " unreachable"
34183418
34193419 if IsGeneratedTypeDirectReference ( typeBeforeArguments, m) then
@@ -3443,7 +3443,7 @@ module EstablishTypeDefinitionCores =
34433443 checkTypeName()
34443444 let resolutionEnvironment =
34453445 match tcrefForContainer.TypeReprInfo with
3446- | TProvidedTypeExtensionPoint info -> info.ResolutionEnvironment
3446+ | TProvidedTypeRepr info -> info.ResolutionEnvironment
34473447 | _ -> failwith " unreachable"
34483448 resolutionEnvironment
34493449
@@ -3848,7 +3848,7 @@ module EstablishTypeDefinitionCores =
38483848 for fspec in fields do
38493849 if not fspec.IsCompilerGenerated then
38503850 let info = RecdFieldInfo( thisTyInst, thisTyconRef.MakeNestedRecdFieldRef fspec)
3851- let nenv ' = AddFakeNameToNameEnv fspec.Name nenv ( Item.RecdField info)
3851+ let nenv ' = AddFakeNameToNameEnv fspec.LogicalName nenv ( Item.RecdField info)
38523852 // Name resolution gives better info for tooltips
38533853 let item = Item.RecdField( FreshenRecdFieldRef cenv.nameResolver m ( thisTyconRef.MakeNestedRecdFieldRef fspec))
38543854 CallNameResolutionSink cenv.tcSink ( fspec.Range, nenv, item, emptyTyparInst, ItemOccurence.Binding, ad)
@@ -3879,7 +3879,7 @@ module EstablishTypeDefinitionCores =
38793879 hiddenReprChecks false
38803880 noAllowNullLiteralAttributeCheck()
38813881 if hasMeasureAttr then
3882- let repr = TFSharpObjectRepr { fsobjmodel_ kind= TTyconClass
3882+ let repr = TFSharpObjectRepr { fsobjmodel_ kind= TFSharpClass
38833883 fsobjmodel_ vslots=[]
38843884 fsobjmodel_ rfields= Construct.MakeRecdFieldsTable [] }
38853885 repr, None, NoSafeInitInfo
@@ -3928,12 +3928,13 @@ module EstablishTypeDefinitionCores =
39283928 let unionCases = TcRecdUnionAndEnumDeclarations.TcUnionCaseDecls cenv envinner innerParent thisTy thisTyInst tpenv unionCases
39293929
39303930 if tycon.IsStructRecordOrUnionTycon && unionCases.Length > 1 then
3931- let fieldNames = [ for uc in unionCases do for ft in uc.FieldTable.TrueInstanceFieldsAsList do yield ft.Name ]
3931+ let fieldNames = [ for uc in unionCases do for ft in uc.FieldTable.TrueInstanceFieldsAsList do yield ft.LogicalName ]
39323932 if fieldNames |> List.distinct |> List.length <> fieldNames.Length then
39333933 errorR( Error( FSComp.SR.tcStructUnionMultiCaseDistinctFields(), m))
39343934
39353935 writeFakeUnionCtorsToSink unionCases
3936- Construct.MakeUnionRepr unionCases, None, NoSafeInitInfo
3936+ let repr = Construct.MakeUnionRepr unionCases
3937+ repr, None, NoSafeInitInfo
39373938
39383939 | SynTypeDefnSimpleRepr.Record (_, fields, _) ->
39393940 noMeasureAttributeCheck()
@@ -3944,7 +3945,8 @@ module EstablishTypeDefinitionCores =
39443945 let recdFields = TcRecdUnionAndEnumDeclarations.TcNamedFieldDecls cenv envinner innerParent false tpenv fields
39453946 recdFields |> CheckDuplicates ( fun f -> f.Id) " field" |> ignore
39463947 writeFakeRecordFieldsToSink recdFields
3947- TRecdRepr ( Construct.MakeRecdFieldsTable recdFields), None, NoSafeInitInfo
3948+ let repr = TFSharpRecdRepr ( Construct.MakeRecdFieldsTable recdFields)
3949+ repr, None, NoSafeInitInfo
39483950
39493951 | SynTypeDefnSimpleRepr.LibraryOnlyILAssembly ( s, _) ->
39503952 let s = ( s :?> ILType)
@@ -4005,20 +4007,20 @@ module EstablishTypeDefinitionCores =
40054007 errorR ( Error( FSComp.SR.tcStructTypesCannotContainAbstractMembers(), m))
40064008 structLayoutAttributeCheck true
40074009
4008- TTyconStruct
4010+ TFSharpStruct
40094011 | SynTypeDefnKind.Interface ->
40104012 if hasSealedAttr = Some true then errorR ( Error( FSComp.SR.tcInterfaceTypesCannotBeSealed(), m))
40114013 noCLIMutableAttributeCheck()
40124014 structLayoutAttributeCheck false
40134015 noAbstractClassAttributeCheck()
40144016 allowNullLiteralAttributeCheck()
40154017 noFieldsCheck userFields
4016- TTyconInterface
4018+ TFSharpInterface
40174019 | SynTypeDefnKind.Class ->
40184020 noCLIMutableAttributeCheck()
40194021 structLayoutAttributeCheck( not isIncrClass)
40204022 allowNullLiteralAttributeCheck()
4021- TTyconClass
4023+ TFSharpClass
40224024 | SynTypeDefnKind.Delegate ( ty, arity) ->
40234025 noCLIMutableAttributeCheck()
40244026 noSealedAttributeCheck FSComp.SR.tcTypesAreAlwaysSealedDelegate
@@ -4032,7 +4034,7 @@ module EstablishTypeDefinitionCores =
40324034 if curriedArgInfos.Length > 1 then error( Error( FSComp.SR.tcDelegatesCannotBeCurried(), m))
40334035 let ttps = thisTyconRef.Typars m
40344036 let fparams = curriedArgInfos.Head |> List.map MakeSlotParam
4035- TTyconDelegate ( MakeSlotSig( " Invoke" , thisTy, ttps, [], [ fparams], returnTy))
4037+ TFSharpDelegate ( MakeSlotSig( " Invoke" , thisTy, ttps, [], [ fparams], returnTy))
40364038 | _ ->
40374039 error( InternalError( " should have inferred tycon kind" , m))
40384040
@@ -4080,7 +4082,7 @@ module EstablishTypeDefinitionCores =
40804082
40814083 | SynTypeDefnSimpleRepr.Enum ( decls, m) ->
40824084 let fieldTy , fields' = TcRecdUnionAndEnumDeclarations.TcEnumDecls cenv envinner innerParent thisTy decls
4083- let kind = TTyconEnum
4085+ let kind = TFSharpEnum
40844086 structLayoutAttributeCheck false
40854087 noCLIMutableAttributeCheck()
40864088 noSealedAttributeCheck FSComp.SR.tcTypesAreAlwaysSealedEnum
@@ -4390,7 +4392,7 @@ module EstablishTypeDefinitionCores =
43904392
43914393 // Phase 1B. Establish the kind of each type constructor
43924394 // Here we run InferTyconKind and record partial information about the kind of the type constructor.
4393- // This means TyconObjModelKind is set, which means isSealedTy, isInterfaceTy etc. give accurate results.
4395+ // This means TyconFSharpObjModelKind is set, which means isSealedTy, isInterfaceTy etc. give accurate results.
43944396 let withAttrs =
43954397 ( envMutRecPrelim, withEnvs) ||> MutRecShapes.mapTyconsWithEnv ( fun envForDecls ( origInfo , tyconOpt ) ->
43964398 let res =
0 commit comments