typeid assertion error with template type with multiple argument #1561

Open
scopatz opened this Issue Dec 21, 2016 · 0 comments

Projects

None yet

1 participant

@scopatz
scopatz commented Dec 21, 2016

On Cython 0.25.2, calling typeid(std_pair[int, int]) will cause the Cython compiler to fail with the error below. Note that templates with a single argument (such as typeid(std_vector[int])) behave as expected.

Traceback (most recent call last):
  File "/home/scopatz/miniconda/bin/cython", line 6, in <module>
    sys.exit(Cython.Compiler.Main.setuptools_main())
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/Main.py", line 694, in setuptools_main
    return main(command_line = 1)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/Main.py", line 711, in main
    result = compile(sources, options)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/Main.py", line 686, in compile
    return compile_multiple(source, options)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/Main.py", line 664, in compile_multiple
    result = run_pipeline(source, options, context=context)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/Main.py", line 494, in run_pipeline
    err, enddata = Pipeline.run_pipeline(pipeline, source)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/Pipeline.py", line 340, in run_pipeline
    data = phase(data)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/Pipeline.py", line 53, in generate_pyx_code_stage
    module_node.process_implementation(options, result)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ModuleNode.py", line 137, in process_implementation
    self.generate_c_code(env, options, result)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ModuleNode.py", line 365, in generate_c_code
    self.body.generate_function_definitions(env, code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/Nodes.py", line 436, in generate_function_definitions
    stat.generate_function_definitions(env, code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/Nodes.py", line 436, in generate_function_definitions
    stat.generate_function_definitions(env, code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/Nodes.py", line 1932, in generate_function_definitions
    self.generate_function_body(env, code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/Nodes.py", line 1699, in generate_function_body
    self.body.generate_execution_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/Nodes.py", line 442, in generate_execution_code
    stat.generate_execution_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/Nodes.py", line 5857, in generate_execution_code
    if_clause.generate_execution_code(code, end_label, is_last=i == last)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/Nodes.py", line 5895, in generate_execution_code
    self.condition.generate_evaluation_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 699, in generate_evaluation_code
    self.generate_subexpr_evaluation_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 714, in generate_subexpr_evaluation_code
    node.generate_evaluation_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 699, in generate_evaluation_code
    self.generate_subexpr_evaluation_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 714, in generate_subexpr_evaluation_code
    node.generate_evaluation_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 12100, in generate_evaluation_code
    self.operand2.generate_evaluation_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 699, in generate_evaluation_code
    self.generate_subexpr_evaluation_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 714, in generate_subexpr_evaluation_code
    node.generate_evaluation_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 699, in generate_evaluation_code
    self.generate_subexpr_evaluation_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 714, in generate_subexpr_evaluation_code
    node.generate_evaluation_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 699, in generate_evaluation_code
    self.generate_subexpr_evaluation_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 714, in generate_subexpr_evaluation_code
    node.generate_evaluation_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 699, in generate_evaluation_code
    self.generate_subexpr_evaluation_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 714, in generate_subexpr_evaluation_code
    node.generate_evaluation_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 705, in generate_evaluation_code
    self.generate_result_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 6957, in generate_result_code
    self.generate_operation_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 7489, in generate_operation_code
    self.generate_sequence_packing_code(code)
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 6961, in generate_sequence_packing_code
    target = self.result()
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 438, in result
    return self.calculate_result_code()
  File "/home/scopatz/miniconda/lib/python3.5/site-packages/Cython/Compiler/ExprNodes.py", line 7448, in calculate_result_code
    return self.result_code
AttributeError: 'TupleNode' object has no attribute 'result_code'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment