Skip to content

Commit b9a8bca

Browse files
committed
Corrected when the native class also implements an interface.
1 parent 199943f commit b9a8bca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/Magick.NET.SourceGenerator/NativeInterop/NativeInteropInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public NativeInteropInfo(SemanticModel semanticModel, SyntaxNode syntaxNode)
2424
.Select(method => new MethodInfo(semanticModel, method))
2525
.ToList();
2626

27-
var isNativeInstance = _class.BaseList?.Types.ToString() == "NativeInstance";
28-
var isConstNativeInstance = _class.BaseList?.Types.ToString() == "ConstNativeInstance";
27+
var isNativeInstance = _class.BaseList?.Types.Any(type => type.ToString() == "NativeInstance") ?? false;
28+
var isConstNativeInstance = _class.BaseList?.Types.Any(type => type.ToString() == "ConstNativeInstance") ?? false;
2929
HasDispose = isNativeInstance;
3030
HasInstance = isNativeInstance || isConstNativeInstance;
3131

0 commit comments

Comments
 (0)