Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Duplicate using causes odd behavior #6

Closed
dested opened this issue Aug 14, 2012 · 1 comment
Closed

Duplicate using causes odd behavior #6

dested opened this issue Aug 14, 2012 · 1 comment

Comments

@dested
Copy link

dested commented Aug 14, 2012

    using foo;
    using foo;
    namespace bar
    {
        public class Bar
        {
            public Bar()
            {
                var fm = new Foo();
                Console.Log(fm);
            }
        }
    }
    namespace foo
    {
        public class Foo
        {

        }
    }
Type.registerNamespace('HeadServer.bar');
////////////////////////////////////////////////////////////////////////////////
// HeadServer.bar.Bar
HeadServer.bar.Bar = function() {
    var fm = HeadServer.foo.Foo;
    console.log(fm);
};
Type.registerNamespace('HeadServer.foo');
////////////////////////////////////////////////////////////////////////////////
// HeadServer.foo.Foo
HeadServer.foo.Foo = function() {
};
Type.registerNamespace('HeadServer.bar');
////////////////////////////////////////////////////////////////////////////////
// HeadServer.bar.Bar
HeadServer.bar.Bar = function() {
    var fm = new HeadServer.foo.Foo();
    console.log(fm);
};
Type.registerNamespace('HeadServer.foo');
////////////////////////////////////////////////////////////////////////////////
// HeadServer.foo.Foo
HeadServer.foo.Foo = function() {
};

I cant quite figure out a way to parse an entire program in a test case, Parser.ParseProgram seems to fail, but the first source will generate the next one, as opposed to the third (which is generated when only one using is used). Im not sure if this is a c# compiler issue or what, but I suppose it should be noted. Took me far too long to track it down....

@erik-kallen
Copy link
Contributor

This is fixed in the upcoming release 1.1.2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants