Skip to content

Commit

Permalink
fixes "System.Reflection.AmbiguousMatchException"
Browse files Browse the repository at this point in the history
```
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()
```
  • Loading branch information
jakubmisek committed Nov 4, 2022
1 parent 204d3ee commit 052327f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Peachpie.Runtime/Reflection/PhpStackTrace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ public string TypeName

if (tinfo.IsPublic && tinfo.IsAbstract) // => public static
{
if (tinfo.Assembly.IsDefined(typeof(PhpExtensionAttribute)))
var extensionAttrs = Attribute.GetCustomAttributes(tinfo.Assembly, typeof(PhpExtensionAttribute));
if (extensionAttrs != null && extensionAttrs.Length != 0)
{
// library function
return null;
Expand Down

0 comments on commit 052327f

Please # to comment.