From fbad192a84e28c84e550a1b7f1beb7713f5c369f Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 11 Jun 2008 14:41:11 -0700 Subject: [PATCH] Fix e_cstruct errors --- Cython/Compiler/ExprNodes.py | 3 ++- tests/errors/e_cstruct.pyx | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 779474af..d4f0ff24 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -2017,7 +2017,8 @@ class AttributeNode(ExprNode): error(self.pos, "Cannot select attribute of incomplete type '%s'" % obj_type) - obj_type = PyrexTypes.error_type + self.type = PyrexTypes.error_type + return self.entry = entry if entry: if obj_type.is_extension_type and entry.name == "__weakref__": diff --git a/tests/errors/e_cstruct.pyx b/tests/errors/e_cstruct.pyx index 05895cb4..238dd216 100644 --- a/tests/errors/e_cstruct.pyx +++ b/tests/errors/e_cstruct.pyx @@ -4,8 +4,8 @@ cdef struct Spam: float *p[42] obj # error - py object -cdef struct Spam: # error - redefined - int j +#cdef struct Spam: # error - redefined (not an error in Cython, should it be?) +# int j cdef struct Grail @@ -19,9 +19,8 @@ cdef void eggs(Spam s): j.i = j # error - no attributes j = gp.x # error - incomplete type gp.x = j # error - incomplete type - _ERRORS = u""" +_ERRORS = u""" /Local/Projects/D/Pyrex/Source/Tests/Errors2/e_cstruct.pyx:5:36: C struct/union member cannot be a Python object -/Local/Projects/D/Pyrex/Source/Tests/Errors2/e_cstruct.pyx:7:5: 'Spam' already defined /Local/Projects/D/Pyrex/Source/Tests/Errors2/e_cstruct.pyx:15:6: Object of type 'Spam' has no attribute 'k' /Local/Projects/D/Pyrex/Source/Tests/Errors2/e_cstruct.pyx:16:6: Cannot assign type 'float *[42]' to 'int' /Local/Projects/D/Pyrex/Source/Tests/Errors2/e_cstruct.pyx:17:21: Cannot assign type 'int' to 'float *[42]' -- 2.26.2