Skip to content

Commit 052327f

Browse files
committed
fixes "System.Reflection.AmbiguousMatchException"
``` System.Reflection.AmbiguousMatchException: Multiple custom attributes of the same type found. at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit) at System.Reflection.CustomAttributeExtensions.GetCustomAttribute[T](Assembly element) at Pchp.Core.Reflection.PhpStackFrame.get_TypeName() at Pchp.Core.Reflection.PhpStackTrace.FrameLine.ToUserFrame() ```
1 parent 204d3ee commit 052327f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Peachpie.Runtime/Reflection/PhpStackTrace.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ public string TypeName
341341

342342
if (tinfo.IsPublic && tinfo.IsAbstract) // => public static
343343
{
344-
if (tinfo.Assembly.IsDefined(typeof(PhpExtensionAttribute)))
344+
var extensionAttrs = Attribute.GetCustomAttributes(tinfo.Assembly, typeof(PhpExtensionAttribute));
345+
if (extensionAttrs != null && extensionAttrs.Length != 0)
345346
{
346347
// library function
347348
return null;

0 commit comments

Comments
 (0)