Euphoria Ticket #222: Error message is wrong when trying to access a symbol in a namespace when the symbol doesn't exist

If you try to access a symbol using a namespace and that symbol is missing the interpreter will tell you to use a namespace:

include smclients.e as clients 
procedure fill_form(integer self, integer event, sequence params) 
	sequence client  
	client = clients:get(current_client) 
	if current_client = 0 then 
		fill_dropdowns( DropDownList_GivenName, DropDownList_FamilyName, 
		getText(DropDownList_GivenName), getText(DropDownList_FamilyName) ) 
	end if 
end procedure 
setHandler(ThisWindow, w32HOpen, routine_id("fill_form") ) 
 

I get the following error:

h:\documents\dev\original\sm\smregistrations.e:33 
<0023>:: A namespace qualifier is needed to resolve 'get' 
because 'get' is declared as a global/public symbol in: 
    h:\documents\dev\original\sm\smcourses.e 
    E:\EUPHORIA\include\std\get.e 
 
    client = clients:get(current_client) 

It should say something like 'get' is not defined as a global/public symbol in the namespace clients.

Details

Type: Bug Report Severity: Minor Category: Interpreter
Assigned To: unknown Status: Fixed Reported Release: 3441
Fixed in SVN #: 3742 View VCS: 3742 Milestone: 4.1.0

1. Comment by DerekParnell Oct 27, 2010

I'm having trouble trying to reproduce this issue.

Can you supply an example that I can run that shows the error?

2. Comment by DerekParnell Oct 31, 2010

Cannot reproduce this yet, and as it is minor issue, plus no one else seems to be concerned with it, let's defer any resolution til after 4.0 release.

3. Comment by jimcbrown Nov 01, 2010

The following example gives me this error:

/tmp/yu2/a.e:5 
<0074>:: Errors resolving the following references: 
    a.e (5): hi 
 
? d:hi(1) 

As of at least 3730, this bug appears to have been fixed.

-- b.e 
public function hi(object x) 
	return x + 1 
end function 
--end 
 
-- c.e 
public function hi(object x) 
	return x + 2 
end function 
-- end 
 
-- d.e 
function jhi(object x) 
	return x + 2 
end function 
-- end 
 
-- a.e 
include b.e as b 
include c.e as c 
include d.e as d 
 
? d:hi(1) 
-- end 

4. Comment by DerekParnell Nov 01, 2010

Changed to a feature request.

The OP I think wants a different message when an identifier is explicitly referred to in a specific namespace but the identifier isn't declared in that namespace.

So in your example, the message should be more like ...

/tmp/yu2/a.e:5  
<0nnn>:: Unresolved because "hi" cannot be found in namespace "d" 
  
? d:hi(1)  
    ^ 

5. Comment by mattlewis Nov 01, 2010

I think that if this had been an issue, it's been resolved. I tried this:

include std/map.e 
include std/regex.e 
include std/get.e 
 
? stdget:new() 

...and got...

bug.ex:6                                                                                                                                  
<0074>:: Errors resolving the following references:                                                                                                          
    bug.ex (6): new                                                                                                                                          
                                                                                                                                                             
? stdget:new()                                                                                                                                               
           ^  

If I instead try:

? new() 

...I get:

bug.ex:6                                                                                                                                  
<0023>:: A namespace qualifier is needed to resolve 'new'                                                                                                    
because 'new' is declared as a global/public symbol in:                                                                                                      
    /usr/local/share/euphoria/include/std/regex.e                                                                                                            
    /usr/local/share/euphoria/include/std/map.e                                                                                                              
                                                                                                                                                             
? new()                                                                                                                                                      
    ^ 

Both errors seem correct to me. This was using svn:3742. I've assigned this back to Shawn to look at, since it looks like it has been fixed.

6. Comment by SDPringle Nov 04, 2010

This works for me the same way it works for you. I am using version 3829. I will change this from Accepted to Fixed.

7. Comment by SDPringle Nov 04, 2010

So, if you want to make this say things should say Unresolved reference: "stddev:get" instead of only "get". It should be on another ticket.

Search



Quick Links

User menu

Not signed in.

Misc Menu