PR# 17405 Resolving of "like argument" uses wrong context.

Problem Report Summary
Submitter: juliant
Category: Compiler
Priority: Low
Date: 2011/03/10
Class: Bug
Severity: Serious
Number: 17405
Release: 6.8.8.5575
Confidential: No
Status: Analyzed
Responsible:
Environment: Windows 7
Synopsis: Resolving of "like argument" uses wrong context.

Description
When "like arguments" are resolved, the context of the current routine is used, even if the like argument is of a different routine.
To Reproduce
Use the following code:

	f (a: INTEGER): like a
		do
		end

	g (a: INTEGER; b: INTEGER): like b
		do
		end

	h (a: STRING)
		local
			x: like f
			y: like g
		do
			x.append ("?")
		end

"x" should be of type INTEGER (first argument of f), but the compiler is happy with the feature "append".
"y" makes the compiler crash, as it is looking for the second argument but in the context of "h" which only has one argument.
Problem Report Interactions
From:manus_eiffel    Date:2011/03/10    Status: Analyzed    Download   
I'm not sure we will try to fix in the short term because anchors to arguments are not supported by the language anymore.