Fix support for nesting classes inside other scripting classes

This commit is contained in:
Wojtek Figat
2025-07-31 15:07:57 +02:00
parent a53a438c3c
commit 08154d8fe5

View File

@@ -270,8 +270,8 @@ namespace Flax.Build.Bindings
{
if (string.Equals(token.Value, ApiTokens.Class, StringComparison.Ordinal))
{
if (!(context.ScopeInfo is FileInfo))
throw new NotImplementedException("TODO: add support for nested classes in scripting API");
if (!(context.ScopeInfo is FileInfo) && !(context.ScopeInfo is ClassInfo))
throw new Exception($"Not supported nested class at line {tokenizer.CurrentLine}. Classes can be nested only in other classes (or in global scope).");
var classInfo = ParseClass(ref context);
scopeType = classInfo;