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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
bfb25060
Commit
bfb25060
authored
Mar 19, 2019
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct type inference for cypclass new statements
parent
0b9833fb
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 @
bfb25060
...
@@ -5410,6 +5410,9 @@ class CallNode(ExprNode):
...
@@ -5410,6 +5410,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
...
@@ -5858,6 +5861,9 @@ class SimpleCallNode(CallNode):
...
@@ -5858,6 +5861,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