Skip to content

Commit 57af262

Browse files
committed
If we are comparing left hand side for is position of type node, it is false, because it is namespace position and not type position
Fixes #837
1 parent 04e2169 commit 57af262

8 files changed

+18
-11
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8467,7 +8467,7 @@ module ts {
84678467
// above them to find the lowest container
84688468
case SyntaxKind.Identifier:
84698469
// If the identifier is the RHS of a qualified name, then it's a type iff its parent is.
8470-
if (node.parent.kind === SyntaxKind.QualifiedName) {
8470+
if (node.parent.kind === SyntaxKind.QualifiedName && (<QualifiedName>node.parent).right === node) {
84718471
node = node.parent;
84728472
}
84738473
// fall through

tests/baselines/reference/cloduleAndTypeParameters.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
class Foo<T extends Foo.Bar> {
33
>Foo : Foo<T>
44
>T : T
5-
>Foo : Foo<T>
5+
>Foo : unknown
66
>Bar : Foo.Bar
77

88
constructor() {

tests/baselines/reference/exportAssignClassAndModule.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Foo = require('exportAssignClassAndModule_0');
55

66
var z: Foo.Bar;
77
>z : Foo.Bar
8-
>Foo : Foo
8+
>Foo : unknown
99
>Bar : Foo.Bar
1010

1111
var zz: Foo;
@@ -23,7 +23,7 @@ class Foo {
2323

2424
x: Foo.Bar;
2525
>x : Foo.Bar
26-
>Foo : Foo
26+
>Foo : unknown
2727
>Bar : Foo.Bar
2828
}
2929
module Foo {

tests/baselines/reference/exportEqualNamespaces.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface server {
1111
>server : server
1212

1313
(): server.Server;
14-
>server : server
14+
>server : unknown
1515
>Server : server.Server
1616

1717
startTime: Date;

tests/baselines/reference/importAliasIdentifiers.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ import clolias = clodule;
6161

6262
var p: clolias.Point;
6363
>p : alias.Point
64-
>clolias : clodule
64+
>clolias : unknown
6565
>Point : clolias.Point
6666

6767
var p: clodule.Point;
6868
>p : alias.Point
69-
>clodule : clodule
69+
>clodule : unknown
7070
>Point : clolias.Point
7171

7272
var p: { x: number; y: number; };

tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface1.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface Foo<T> {
1313
}
1414
var Foo: new () => Foo.A<Foo<string>>;
1515
>Foo : new () => Foo.A<Foo<string>>
16-
>Foo : Foo<T>
16+
>Foo : unknown
1717
>A : Foo.A<T>
1818
>Foo : Foo<T>
1919

tests/cases/fourslash/augmentedTypesModule6.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010

1111
goTo.marker('1');
1212
verify.completionListContains('I');
13-
14-
// bug #837
15-
verify.completionListContains('foo');
13+
verify.not.completionListContains('foo');
1614
edit.insert('I;');
1715

1816
goTo.marker('2');
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// <reference path='fourslash.ts'/>
2+
3+
////declare class m3f { foo(x: number): void }
4+
////module m3f { export interface I { foo(): void } }
5+
////var x: m3f./**/
6+
7+
goTo.marker();
8+
debugger;
9+
verify.not.completionListContains("foo");

0 commit comments

Comments
 (0)