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
7b490853
Commit
7b490853
authored
Mar 19, 2019
by
gsamain
Committed by
Xavier Thompson
Jun 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct type inference for cypclass new statements
parent
5e2f170b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+8
-2
No files found.
Cython/Compiler/ExprNodes.py
View file @
7b490853
...
@@ -5477,6 +5477,9 @@ class CallNode(ExprNode):
...
@@ -5477,6 +5477,9 @@ class CallNode(ExprNode):
func_type
=
function
.
infer_type
(
env
)
func_type
=
function
.
infer_type
(
env
)
if
isinstance
(
function
,
NewExprNode
):
if
isinstance
(
function
,
NewExprNode
):
# note: needs call to infer_type() above
# note: needs call to infer_type() above
if
function
.
class_type
.
is_cyp_class
:
return
function
.
class_type
else
:
return
PyrexTypes
.
CPtrType
(
function
.
class_type
)
return
PyrexTypes
.
CPtrType
(
function
.
class_type
)
if
func_type
is
py_object_type
:
if
func_type
is
py_object_type
:
# function might have lied for safety => try to find better type
# function might have lied for safety => try to find better type
...
@@ -5936,6 +5939,9 @@ class SimpleCallNode(CallNode):
...
@@ -5936,6 +5939,9 @@ class SimpleCallNode(CallNode):
# Calc result type and code fragment
# Calc result type and code fragment
if
isinstance
(
self
.
function
,
NewExprNode
):
if
isinstance
(
self
.
function
,
NewExprNode
):
if
self
.
function
.
class_type
.
is_cyp_class
:
self
.
type
=
self
.
function
.
class_type
else
:
self
.
type
=
PyrexTypes
.
CPtrType
(
self
.
function
.
class_type
)
self
.
type
=
PyrexTypes
.
CPtrType
(
self
.
function
.
class_type
)
else
:
else
:
self
.
type
=
func_type
.
return_type
self
.
type
=
func_type
.
return_type
...
...
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