Repository: cython/cython

Issue:
[BUG] fused types stopped working with cimport_from_pyx=True
### Describe the bug

### Describe the bug

Cythonization of .pyx with fused types when cimport_from_pyx=True stopped working recently.
It was working on 3.0.0b1 and it does not work now on 3.0.5. I didn't dig into when it stopped working exactly.

Here's the error:
```
  tree = Parsing.p_module(s, pxd, full_module_name)
Traceback (most recent call last):
  File "B:\_\setup.py", line 10, in <module>
    ext_modules=cythonize("hello.pyx"),
  File "C:\Anaconda3\envs\work_pip2\lib\site-packages\Cython\Build\Dependencies.py", line 1154, in cythonize
    cythonize_one(*args)
  File "C:\Anaconda3\envs\work_pip2\lib\site-packages\Cython\Build\Dependencies.py", line 1300, in cythonize_one
    result = compile_single(pyx_file, options, full_module_name=full_module_name)
  File "C:\Anaconda3\envs\work_pip2\lib\site-packages\Cython\Compiler\Main.py", line 615, in compile_single
    return run_pipeline(source, options, full_module_name)
  File "C:\Anaconda3\envs\work_pip2\lib\site-packages\Cython\Compiler\Main.py", line 539, in run_pipeline
    err, enddata = Pipeline.run_pipeline(pipeline, source)
  File "C:\Anaconda3\envs\work_pip2\lib\site-packages\Cython\Compiler\Pipeline.py", line 398, in run_pipeline
    data = run(phase, data)
  File "C:\Anaconda3\envs\work_pip2\lib\site-packages\Cython\Compiler\Pipeline.py", line 375, in run
    return phase(data)
  File "C:\Anaconda3\envs\work_pip2\lib\site-packages\Cython\Compiler\Pipeline.py", line 52, in generate_pyx_code_stage
    module_node.process_implementation(options, result)
  File "C:\Anaconda3\envs\work_pip2\lib\site-packages\Cython\Compiler\ModuleNode.py", line 222, in process_implementation
    self.generate_c_code(env, options, result)
  File "C:\Anaconda3\envs\work_pip2\lib\site-packages\Cython\Compiler\ModuleNode.py", line 516, in generate_c_code
    self.body.generate_function_definitions(env, code)
  File "C:\Anaconda3\envs\work_pip2\lib\site-packages\Cython\Compiler\Nodes.py", line 404, in generate_function_definitions
    stat.generate_function_definitions(env, code)
  File "Cython\\Compiler\\FusedNode.py", line 961, in Cython.Compiler.FusedNode.FusedCFuncDefNode.generate_function_definitions
AttributeError: 'DictNode' object has no attribute 'entry'
```

My setup.py:

```
from setuptools import setup
from Cython.Build import cythonize
import Cython.Compiler.Options


Cython.Compiler.Options.cimport_from_pyx = True


setup(
    name='Hello',
    ext_modules=cythonize("hello.pyx"),
)

```


### Code to reproduce the behaviour:

```cython
ctypedef fused float_or_int:
    float
    int

cpdef function(float_or_int a):
    pass
```

### Expected behaviour

It should get cythonized and compiled successfully as it was before

### OS

Windows 10

### Python version

3.9

### Cython version

3.0.5

### Additional context

_No response_


Discussion:

Resolving patch:
diff --git a/Cython/Compiler/FusedNode.py b/Cython/Compiler/FusedNode.py
--- a/Cython/Compiler/FusedNode.py
+++ b/Cython/Compiler/FusedNode.py
@@ -958,8 +958,9 @@ def generate_function_definitions(self, env, code):
 
         from . import Options
         for stat in self.stats:
-            from_pyx = Options.cimport_from_pyx and not stat.entry.visibility == 'extern'
-            if isinstance(stat, FuncDefNode) and (stat.entry.used or from_pyx):
+            if isinstance(stat, FuncDefNode) and (
+                    stat.entry.used or
+                    (Options.cimport_from_pyx and not stat.entry.visibility == 'extern')):
                 code.mark_pos(stat.pos)
                 stat.generate_function_definitions(env, code)
 


Test patch:
diff --git a/tests/run/cimport_from_pyx.srctree b/tests/run/cimport_from_pyx.srctree
--- a/tests/run/cimport_from_pyx.srctree
+++ b/tests/run/cimport_from_pyx.srctree
@@ -96,5 +96,8 @@ cdef fused_checker(fused_type i):
     else:
         return False
 
+cpdef fused_cpdef(fused_type i):
+    return not fused_checker(i)
+
 def test():
-    return fused_checker(0)
+    return fused_checker(0) and fused_cpdef(1.0)