Skip to content

Commit 0478498

Browse files
committed
Ignore functions returning tag types for now in JS generation.
1 parent 258129a commit 0478498

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/Generator/Options.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ public bool DoAllModulesHaveLibraries() =>
205205

206206
public bool IsCLIGenerator => GeneratorKind == GeneratorKind.CLI;
207207

208+
public bool IsJSGenerator => GeneratorKind == GeneratorKind.Emscripten || GeneratorKind == GeneratorKind.QuickJS;
209+
208210
public readonly List<string> DependentNameSpaces = new List<string>();
209211
public bool MarshalCharAsManagedChar { get; set; }
210212
public bool MarshalConstCharArrayAsString { get; set; } = true;

src/Generator/Passes/CheckIgnoredDecls.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,14 @@ public override bool VisitFunctionDecl(Function function)
184184
return false;
185185
}
186186

187+
if (Options.IsJSGenerator && function is Method { Kind: CXXMethodKind.Normal } && ret.Type.GetFinalPointee().IsClass())
188+
{
189+
function.ExplicitlyIgnore();
190+
Diagnostics.Debug("Function '{0}' was ignored due to {1} return decl not yet implemented in JS generators",
191+
function.Name, msg);
192+
return false;
193+
}
194+
187195
foreach (var param in function.Parameters)
188196
{
189197
if (HasInvalidDecl(param, out msg))

0 commit comments

Comments
 (0)