PR# 19981 Conversion queries: convert type base class conforming ancestor

Problem Report Summary
Submitter: gobobe
Category: Compiler
Priority: Low
Date: 2026/05/25
Class: Bug
Severity: Non-critical
Number: 19981
Release: 25.12.9.8922
Confidential: No
Status: Open
Responsible:
Environment: win
Synopsis: Conversion queries: convert type base class conforming ancestor

Description
The compiler should forbid the case where the base class of a convert type of a conversion query is a conforming ancestor of class where the conversion query is declared. Otherwise we might end up with a type which both conforms and converts to another type.

In the example below, `BB` declares a conversion query of the form `f: {CC [G]}` but `CC` is a conforming ancestor of `BB`. For the actual generic derivation `BB [INTEGER]` we end up with an ambiguous behavior where `BB [INTEGER]` both conforms and converts to `CC [INTEGER]`.

--
Eric Bezault
To Reproduce
class AA

create

	make

feature

	make
		local
			b: BB [INTEGER]
			c: CC [INTEGER]
		do
			create b
			c := b
		end

end
~~~~
class BB [G -> ANY]

inherit

	CC [INTEGER]

convert

	f: {CC [G]}

feature

	f: CC [G]
		do
			create Result
		end

end
~~~~
class CC [G]

end

Problem Report Interactions