diff --git a/lib/core/Handles/HandlesFunctions.py b/lib/core/Handles/HandlesFunctions.py index 87d1d71..8d7c6dd 100644 --- a/lib/core/Handles/HandlesFunctions.py +++ b/lib/core/Handles/HandlesFunctions.py @@ -2101,7 +2101,9 @@ class FunctionHandle(BaseHandle): _DeclMarkers: tuple[str, ...] = ( tuple(getattr(Node, 'Markers', None) or ()) + tuple(getattr(Node.returns, 'Markers', None) or ())) - _IsDecl: bool = any(m in ('state', 'export', 'extern') for m in _DeclMarkers) + _IsDecl: bool = (any(m in ('state', 'export', 'extern') for m in _DeclMarkers) + or bool(getattr(Node, 'Extern', False)) + or bool(getattr(Node, 'Export', False))) if not _IsDecl and not _IsVoidOrDeclAnnotation(Node.returns): raise Exception( f"函数 {Node.name} 声明了返回类型但函数体可能掉出末尾(缺少 return 语句);"