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
Kirill Smelkov
cython
Commits
52eaf5ce
Commit
52eaf5ce
authored
Dec 26, 2013
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix declaration error test.
parent
6837c510
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+5
-3
tests/errors/e_declarations.pyx
tests/errors/e_declarations.pyx
+2
-1
No files found.
Cython/Compiler/Nodes.py
View file @
52eaf5ce
...
@@ -535,9 +535,10 @@ class CArrayDeclaratorNode(CDeclaratorNode):
...
@@ -535,9 +535,10 @@ class CArrayDeclaratorNode(CDeclaratorNode):
values
=
[
v
.
analyse_as_type
(
env
)
for
v
in
args
]
values
=
[
v
.
analyse_as_type
(
env
)
for
v
in
args
]
if
None
in
values
:
if
None
in
values
:
ix
=
values
.
index
(
None
)
ix
=
values
.
index
(
None
)
error
(
args
[
ix
].
pos
,
"Template parameter not a type."
)
error
(
args
[
ix
].
pos
,
"Template parameter not a type"
)
return
error_type
base_type
=
error_type
base_type
=
base_type
.
specialize_here
(
self
.
pos
,
values
)
else
:
base_type
=
base_type
.
specialize_here
(
self
.
pos
,
values
)
return
self
.
base
.
analyse
(
base_type
,
env
,
nonempty
=
nonempty
)
return
self
.
base
.
analyse
(
base_type
,
env
,
nonempty
=
nonempty
)
if
self
.
dimension
:
if
self
.
dimension
:
self
.
dimension
=
self
.
dimension
.
analyse_const_expression
(
env
)
self
.
dimension
=
self
.
dimension
.
analyse_const_expression
(
env
)
...
@@ -591,6 +592,7 @@ class CFuncDeclaratorNode(CDeclaratorNode):
...
@@ -591,6 +592,7 @@ class CFuncDeclaratorNode(CDeclaratorNode):
template_nodes
=
[
template_node
]
template_nodes
=
[
template_node
]
else
:
else
:
error
(
template_node
.
pos
,
"Template arguments must be a list of names"
)
error
(
template_node
.
pos
,
"Template arguments must be a list of names"
)
return
None
self
.
templates
=
[]
self
.
templates
=
[]
for
template
in
template_nodes
:
for
template
in
template_nodes
:
if
isinstance
(
template
,
NameNode
):
if
isinstance
(
template
,
NameNode
):
...
...
tests/errors/e_declarations.pyx
View file @
52eaf5ce
...
@@ -12,7 +12,8 @@ cdef void f():
...
@@ -12,7 +12,8 @@ cdef void f():
_ERRORS
=
u"""
_ERRORS
=
u"""
3:19: Array element cannot be a function
3:20: Template arguments must be a list of names
3:20: Template parameter not a type
5:18: Function cannot return a function
5:18: Function cannot return a function
10:10: Function cannot return a function
10:10: Function cannot return a function
10:5: Cannot cast to a function type
10:5: Cannot cast to a function 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