Euphoria Ticket #617: Unqualified switch constants not resolving

Using constants from another file without qualifying them results in symbol resolution errors:

-- bug.e 
public constant PUBLIC = 1 
export constant EXPORT = 2 
global constant GLOBAL = 3 
 
-- bug.ex 
include bug.e 
 
constant LOCAL = 4 
 
for i = 1 to 4 do 
	switch i do 
		case PUBLIC then 
			puts(1, "public\n" ) 
		case GLOBAL then 
			puts(1, "global\n") 
		case EXPORT then 
			puts(1, "export\n") 
		case LOCAL then 
			puts(1, "local\n") 
		case else 
			puts(1, "??\n") 
	end switch 
end for 

Result:

$ eui bug 
bug.ex:11 
<0074>:: Errors resolving the following references: 
    bug.ex (7): PUBLIC 
    bug.ex (9): GLOBAL 
    bug.ex (11): EXPORT 
 
        case EXPORT then 
                    ^ 

Details

Type: Bug Report Severity: Major Category: Front End
Assigned To: unknown Status: Fixed Reported Release:
Fixed in SVN #: View VCS: none Milestone: 4.0.1

1. Comment by mattlewis Feb 25, 2011

See: hg:euphoria/rev/e38ce6c0f0cc

changeset: 4673:e38ce6c0f0cc branch: 4.0 parent: 4671:7813d419a028 user: Matt Lewis date: Fri Feb 25 06:59:04 2011 -0500 files: docs/release/4.0.1.txt source/fwdref.e tests/switch_constants.e tests/t_switch.e description:

  • top level switch statements with cases referencing unqualified constants in other files are now properly resolved
  • added unit test for this issue in t_switch.e
  • fixes ticket 617

2. Comment by mattlewis Feb 25, 2011

See: hg:euphoria/rev/92baf8943324

changeset: 4674:92baf8943324 tag: tip parent: 4672:ffd690fa76de parent: 4673:e38ce6c0f0cc user: Matt Lewis date: Fri Feb 25 07:11:34 2011 -0500 files: docs/release/4.0.1.txt source/fwdref.e tests/t_switch.e description:

  • merge ticket 617 into the trunk

Search



Quick Links

User menu

Not signed in.

Misc Menu