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
61ee8e54
Commit
61ee8e54
authored
Jul 02, 2015
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More typedef type inference tests.
parent
471a4700
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
tests/run/type_inference.pyx
tests/run/type_inference.pyx
+18
-0
No files found.
tests/run/type_inference.pyx
View file @
61ee8e54
...
...
@@ -681,6 +681,24 @@ cdef enum MyEnum:
enum_x
=
1
enum_y
=
2
ctypedef
long
my_long
def
test_int_typedef_inference
():
"""
>>> test_int_typedef_inference()
"""
cdef
long
x
=
1
cdef
my_long
y
=
2
cdef
long
long
z
=
3
assert
typeof
(
x
+
y
)
==
typeof
(
y
+
x
)
==
'my_long'
,
typeof
(
x
+
y
)
assert
typeof
(
y
+
z
)
==
typeof
(
z
+
y
)
==
'long long'
,
typeof
(
y
+
z
)
from
libc.stdint
cimport
int32_t
,
int64_t
def
int64_long_sum
():
cdef
long
x
=
1
cdef
int32_t
x32
=
2
cdef
int64_t
x64
=
3
assert
typeof
(
x
+
x32
)
==
typeof
(
x32
+
x
)
==
'long'
,
typeof
(
x
+
x32
)
assert
typeof
(
x
+
x64
)
==
typeof
(
x64
+
x
)
==
'int64_t'
,
typeof
(
x
+
x64
)
cdef
class
InferInProperties
:
"""
...
...
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