Also check inheritance for union and intersection types

This commit is contained in:
Richard Knoll
2016-08-29 18:09:16 -07:00
parent 051c7b0217
commit 115141cb50
4 changed files with 80 additions and 67 deletions

View File

@@ -1,9 +1,12 @@
/// <reference path='fourslash.ts'/>
// Should handle intersection types
// Should handle union and intersection types
//// interface Foo {
//// interface BaseFoo {
//// hello(): void;
//// }
////
//// interface Foo extends BaseFoo {
//// aloha(): void;
//// }
////
@@ -13,12 +16,16 @@
//// }
////
//// class FooImpl implements Foo {
//// hello() {/**FooImpl*/}
//// [|hello() {/**FooImpl*/}|]
//// aloha() {}
//// }
////
//// class BaseFooImpl implements BaseFoo {
//// hello() {/**BaseFooImpl*/} // Should not show up
//// }
////
//// class BarImpl implements Bar {
//// hello() {/**BarImpl*/}
//// [|hello() {/**BarImpl*/}|]
//// goodbye() {}
//// }
////
@@ -28,9 +35,15 @@
//// goodbye() {}
//// }
////
//// function someFunction(x: Foo & Bar) {
//// x.he/*function_call*/llo();
//// function someFunction(x: Foo | Bar) {
//// x.he/*function_call0*/llo();
//// }
////
//// function anotherFunction(x: Foo & Bar) {
//// x.he/*function_call1*/llo();
//// }
goTo.marker("function_call");
verify.allRangesAppearInImplementationList();
for (var i = 0; i < 2; i++) {
goTo.marker("function_call" + i);
verify.allRangesAppearInImplementationList();
}

View File

@@ -1,36 +1,12 @@
/// <reference path='fourslash.ts'/>
// Should handle union types
//// interface Foo {
//// hello(): void;
//// aloha(): void;
//// }
////
//// interface Bar {
//// hello(): void;
//// goodbye(): void;
//// }
////
//// class FooImpl implements Foo {
//// [|hello() {/**FooImpl*/}|]
//// aloha() {}
//// }
////
//// class BarImpl implements Bar {
//// [|hello() {/**BarImpl*/}|]
//// goodbye() {}
//// }
////
//// class FooAndBarImpl implements Foo, Bar {
//// [|hello() {/**FooAndBarImpl*/}|]
//// aloha() {}
//// goodbye() {}
//// }
////
//// function someFunction(x: Foo | Bar) {
//// x.he/*function_call*/llo();
//// }
goTo.marker("function_call");
verify.allRangesAppearInImplementationList();
/// <reference path='fourslash.ts'/>
// Should handle members of object literals in type assertion expressions
//// interface Foo {
//// hel/*reference*/lo(): void;
//// }
////
//// var x = <Foo> { [|hello: () => {}|] };
//// var y = <Foo> (((({ [|hello: () => {}|] }))));
goTo.marker("reference");
verify.allRangesAppearInImplementationList();

View File

@@ -1,12 +0,0 @@
/// <reference path='fourslash.ts'/>
// Should handle members of object literals in type assertion expressions
//// interface Foo {
//// hel/*reference*/lo(): void;
//// }
////
//// var x = <Foo> { [|hello: () => {}|] };
//// var y = <Foo> (((({ [|hello: () => {}|] }))));
goTo.marker("reference");
verify.allRangesAppearInImplementationList();