/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Compilers/VisualBasic/Portable/Emit/SourceAssemblySymbolAdapter.vb
29 строк
1 KB
AlekseyTs
Propagate marked attributes to synthesized fields. (#76567)
03 янв 2025, 02:15
Не верифицирован
03 янв 2025, 02:15
bfa4f1a
Код
Авторство
О чём код?
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports Microsoft.CodeAnalysis.PooledObjects Imports Microsoft.CodeAnalysis.VisualBasic.Emit Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols Partial Friend Class SourceAssemblySymbol Friend Function GetAssemblyCustomAttributesToEmit(moduleBuilder As PEModuleBuilder, emittingRefAssembly As Boolean, emittingAssemblyAttributesInNetModule As Boolean) As IEnumerable(Of VisualBasicAttributeData) Dim synthesized As ArrayBuilder(Of VisualBasicAttributeData) = Nothing AddSynthesizedAttributes(moduleBuilder, synthesized) If emittingRefAssembly AndAlso Not HasReferenceAssemblyAttribute Then Dim referenceAssemblyAttribute = Me.DeclaringCompilation. TrySynthesizeAttribute(WellKnownMember.System_Runtime_CompilerServices_ReferenceAssemblyAttribute__ctor, isOptionalUse:=True) Symbol.AddSynthesizedAttribute(synthesized, referenceAssemblyAttribute) End If Return GetCustomAttributesToEmit(Me.GetAttributes(), synthesized, isReturnType:=False, emittingAssemblyAttributesInNetModule:=emittingAssemblyAttributesInNetModule) End Function End Class End Namespace