Ticket #12216 (new defect)

Opened 18 months ago

Coercion to CC via _complex_mpfr_field_ can lead to infinite loop

Reported by: mraum Owned by: robertwb
Priority: major Milestone: sage-5.11
Component: coercion Keywords: CC, LazyWrapper
Cc: Work issues:
Report Upstream: N/A Reviewers:
Authors: Merged in:
Dependencies: Stopgaps:

Description

I encountered this when working on #9439. Creating an element with parent and providing the method _complex_mpfr_field_ for conversion into CC can lead to an infinite loop, if said method returns a non-trivial element of CC.

I couldn't find a minimal example, but as I said it occured when I worked on #9439, where points in HH should be convertible into CC.

The reason seems to be that the coercion framework tries to use CLF first. The application of the corresponding LazyWrapperMorphism? leads to an element of CLF, that then cannot be evaluated correctly, because .eval of this elements calls CC._element_constructor_, which in turn calls .eval of that element (via _complex_mpfr_field_ of this element).

Note: See TracTickets for help on using tickets.