Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
69d0430d
Commit
69d0430d
authored
Dec 11, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and type-check casts to qualified cypclass
parent
f7b2cfd1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+3
-0
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+2
-1
No files found.
Cython/Compiler/ExprNodes.py
View file @
69d0430d
...
@@ -10951,6 +10951,9 @@ class TypecastNode(ExprNode):
...
@@ -10951,6 +10951,9 @@ class TypecastNode(ExprNode):
self
.
op_func_type
=
entry
.
type
self
.
op_func_type
=
entry
.
type
if
self
.
type
.
is_cyp_class
:
if
self
.
type
.
is_cyp_class
:
self
.
is_temp
=
self
.
overloaded
self
.
is_temp
=
self
.
overloaded
if
self
.
type
.
is_qualified_cyp_class
:
if
not
self
.
type
.
assignable_from
(
self
.
operand
.
type
):
error
(
self
.
pos
,
"Cannot cast %s to %s"
%
(
self
.
operand
.
type
,
self
.
type
))
if
self
.
type
.
is_ptr
and
self
.
type
.
base_type
.
is_cfunction
and
self
.
type
.
base_type
.
nogil
:
if
self
.
type
.
is_ptr
and
self
.
type
.
base_type
.
is_cfunction
and
self
.
type
.
base_type
.
nogil
:
op_type
=
self
.
operand
.
type
op_type
=
self
.
operand
.
type
if
op_type
.
is_ptr
:
if
op_type
.
is_ptr
:
...
...
Cython/Compiler/Parsing.py
View file @
69d0430d
...
@@ -321,7 +321,8 @@ def p_typecast(s):
...
@@ -321,7 +321,8 @@ def p_typecast(s):
is_memslice
=
isinstance
(
base_type
,
Nodes
.
MemoryViewSliceTypeNode
)
is_memslice
=
isinstance
(
base_type
,
Nodes
.
MemoryViewSliceTypeNode
)
is_template
=
isinstance
(
base_type
,
Nodes
.
TemplatedTypeNode
)
is_template
=
isinstance
(
base_type
,
Nodes
.
TemplatedTypeNode
)
is_const_volatile
=
isinstance
(
base_type
,
Nodes
.
CConstOrVolatileTypeNode
)
is_const_volatile
=
isinstance
(
base_type
,
Nodes
.
CConstOrVolatileTypeNode
)
if
not
is_memslice
and
not
is_template
and
not
is_const_volatile
and
base_type
.
name
is
None
:
is_qualified
=
isinstance
(
base_type
,
Nodes
.
QualifiedCypclassNode
)
if
not
is_memslice
and
not
is_template
and
not
is_const_volatile
and
not
is_qualified
and
base_type
.
name
is
None
:
s
.
error
(
"Unknown type"
)
s
.
error
(
"Unknown type"
)
declarator
=
p_c_declarator
(
s
,
empty
=
1
)
declarator
=
p_c_declarator
(
s
,
empty
=
1
)
if
s
.
sy
==
'?'
:
if
s
.
sy
==
'?'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment