History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-913
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Marcus Griep
Reporter: Marcus Griep
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

Compiler searches default imports first for import statements rather than global namespace

Created: 06/Nov/07 12:37 PM   Updated: 06/Nov/07 02:16 PM
Component/s: Compiler
Affects Version/s: 0.8
Fix Version/s: 0.8.1

Time Tracking:
Not Specified

Testcase included: yes


 Description  « Hide
In the code below, the compiler will believe that "Builtins" should mean "Boo.Lang.Builtins" when we want it to be the locally defined "Builtins" class:
"""
true
"""
import Builtins
		
class Builtins:
	static def DoIt():
		return true
	
a = DoIt()
print(a)

Correct output from BooPrinter is:

import Builtins

public class Builtins(object):

        public static def DoIt() as bool:
                return true

        public def constructor():
                super()

[System.Runtime.CompilerServices.CompilerGlobalScopeAttribute]
public final transient class BOO-999-1Module(object):

        private static def Main(argv as (string)) as void:
                a = Builtins.DoIt()
                Boo.Lang.Builtins.print(a)

        private def constructor():
                super()

Instead, the following is output:

import Builtins

public class Builtins(object):

        public static def DoIt() as bool:
                return true

        public def constructor():
                super()

[System.Runtime.CompilerServices.CompilerGlobalScopeAttribute]
public final transient class BOO-999-1Module(object):

        private static def Main(argv as (string)) as void:
                a = DoIt()
                Boo.Lang.Builtins.print(a)

        private def constructor():
                super()

Leaving Boo.Lang.Compiler.Steps.PrintBoo
testcases\regression\BOO-999-1.boo(7,5): BCE0005: Boo.Lang.Compiler.CompilerError: Unknown identifier: 'DoIt'.


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Marcus Griep - 06/Nov/07 02:16 PM
Revision 2749.

No, wait. Revision 2750.

Ok, I'm stupid. Revision 2751.

(Move along; nothing to see here...)