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

Are types available in a flat namespace? #8

Open
samuelgoto opened this issue Jul 11, 2017 · 1 comment
Open

Are types available in a flat namespace? #8

samuelgoto opened this issue Jul 11, 2017 · 1 comment

Comments

@samuelgoto
Copy link
Owner

(porting @Waldemar's comments into github issues)

@Waldemar: on scoping, are types available in a flat namespace? For example:

function a() { 
  class B { foo() { console.log("bar"); } }; 
  var b = new B(); 
  b.foo();
}

class B {    
}

var c:B = new B();
// NOTE(waldemar): which B does c refer to from a type-checking perspective?
// NOTE(goto, dimvar): types follows the interpreter scoping rules. For example, 
// the typechecker complains on the following line that "property foo()" does not
// exist on type "B".
c.foo(); // Error
@samuelgoto
Copy link
Owner Author

Modules?

@Waldemar: namespaces, scoping for identifiers versus types.

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

No branches or pull requests

1 participant