Permalink
Browse files

Fix non-template nested class declarations.

  • Loading branch information...
1 parent 3b21621 commit f9068f3de1ca260e0ff70e64c07b934adf9ef317 @robertwb robertwb committed Oct 30, 2012
Showing with 15 additions and 3 deletions.
  1. +15 −3 Cython/Compiler/Nodes.py
View
@@ -818,9 +818,21 @@ def analyse(self, env, could_be_name = False):
type = py_object_type
else:
if self.module_path:
- scope = env.find_imported_module(self.module_path, self.pos)
- if scope:
- scope.fused_to_specific = env.fused_to_specific
+ # Maybe it's a nested C++ class.
+ scope = env
+ for item in self.module_path:
+ entry = scope.lookup(item)
+ if entry.is_cpp_class:
+ scope = entry.type.scope
+ else:
+ scope = None
+ break
+
+ if scope is None:
+ # Maybe it's a cimport.
+ scope = env.find_imported_module(self.module_path, self.pos)
+ if scope:
+ scope.fused_to_specific = env.fused_to_specific
else:
scope = env

0 comments on commit f9068f3

Please sign in to comment.