Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling constructor of a class within a module requires explicit importing of the module #6483

Closed
kingroryg opened this issue Jun 16, 2017 · 1 comment

Comments

@kingroryg
Copy link
Member

Calling constructor of a class within a module requires explicit importing of the module. It should work without importing the module as both the module and the code using it is present within the same file.

Snippet 1:

module M {
         class A {
                 proc A(a: int) {
                         writeln("hello");
                 }
         }
 }
 var obj = new M.A(23);

Snippet 2:

module M {
 	class A {
 		proc A(a: int) {
 			writeln("hello");
 		}
 	}
 }
 use M;
 var obj = new M.A(23);

Running Snippet 1 gives the error "error: unresolved call 'A.init(23) whereas Snippet 2 runs fine.

@lydia-duncan
Copy link
Member

This was resolved with #6810 and friends last month (thanks Mike!)

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

No branches or pull requests

2 participants