From 08154d8fe5919c01be0f4494d531c67ab9260083 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 31 Jul 2025 15:07:57 +0200 Subject: [PATCH] Fix support for nesting classes inside other scripting classes --- Source/Tools/Flax.Build/Bindings/BindingsGenerator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.cs index b1c388e29..9ecb5ecd3 100644 --- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.cs +++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.cs @@ -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;