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
073f25c1
Commit
073f25c1
authored
Oct 24, 2019
by
da-woods
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bring attribute.fused types in line
parent
1b5b0a51
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
+21
-4
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+10
-4
tests/run/fused_cpp.pyx
tests/run/fused_cpp.pyx
+11
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
073f25c1
...
@@ -6907,14 +6907,20 @@ class AttributeNode(ExprNode):
...
@@ -6907,14 +6907,20 @@ class AttributeNode(ExprNode):
return
None
return
None
def
analyse_as_type
(
self
,
env
):
def
analyse_as_type
(
self
,
env
):
tp
=
None
module_scope
=
self
.
obj
.
analyse_as_module
(
env
)
module_scope
=
self
.
obj
.
analyse_as_module
(
env
)
if
module_scope
:
if
module_scope
:
return
module_scope
.
lookup_type
(
self
.
attribute
)
tp
=
module_scope
.
lookup_type
(
self
.
attribute
)
if
not
self
.
obj
.
is_string_literal
:
el
if
not
self
.
obj
.
is_string_literal
:
base_type
=
self
.
obj
.
analyse_as_type
(
env
)
base_type
=
self
.
obj
.
analyse_as_type
(
env
)
if
base_type
and
hasattr
(
base_type
,
'scope'
)
and
base_type
.
scope
is
not
None
:
if
base_type
and
hasattr
(
base_type
,
'scope'
)
and
base_type
.
scope
is
not
None
:
return
base_type
.
scope
.
lookup_type
(
self
.
attribute
)
tp
=
base_type
.
scope
.
lookup_type
(
self
.
attribute
)
return
None
if
tp
and
tp
.
is_fused
and
env
.
fused_to_specific
:
try
:
tp
=
tp
.
specialize
(
env
.
fused_to_specific
)
except
KeyError
:
pass
# just use unspecialized type
return
tp
def
analyse_as_extension_type
(
self
,
env
):
def
analyse_as_extension_type
(
self
,
env
):
# Try to interpret this as a reference to an extension type
# Try to interpret this as a reference to an extension type
...
...
tests/run/fused_cpp.pyx
View file @
073f25c1
...
@@ -30,3 +30,14 @@ def typeid_call(C x):
...
@@ -30,3 +30,14 @@ def typeid_call(C x):
"""
"""
cdef
const
type_info
*
a
=
&
typeid
(
C
)
cdef
const
type_info
*
a
=
&
typeid
(
C
)
return
a
[
0
]
==
tidint
[
0
]
return
a
[
0
]
==
tidint
[
0
]
cimport
cython
def
typeid_call2
(
cython
.
integral
x
):
"""
For GH issue 3203
>>> typeid_call2[int](1)
True
"""
cdef
const
type_info
*
a
=
&
typeid
(
cython
.
integral
)
return
a
[
0
]
==
tidint
[
0
]
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