Skip to content

Commit ee041fe

Browse files
committed
Fixed incorrect handling generic type alias
Fixes #4
1 parent 36b160f commit ee041fe

File tree

3 files changed

+32
-7
lines changed

3 files changed

+32
-7
lines changed

src/transformer.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,6 @@ function createTransformerFactory(program: ts.Program, options?: Partial<RenameO
264264
}
265265
}
266266

267-
if (type.aliasTypeArguments !== undefined) {
268-
const hasExternalSubType = type.aliasTypeArguments.some((t: ts.Type) => isTypePropertyExternal(t, typePropertyName));
269-
if (hasExternalSubType) {
270-
return hasExternalSubType;
271-
}
272-
}
273-
274267
const symbol = type.getSymbol();
275268
if (symbol !== undefined) {
276269
const declarations = getDeclarationsForSymbol(symbol);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class Foo<Type extends string> {
2+
public search(): void {}
3+
}
4+
5+
type StringFoo<T extends string> = Foo<T>;
6+
7+
class Bar {
8+
private foo: StringFoo<string> = new Foo();
9+
10+
public doSomething(): void {
11+
this.foo.search();
12+
}
13+
}
14+
15+
export interface FooBar {}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
var Foo = /** @class */ (function () {
4+
function Foo() {
5+
}
6+
Foo.prototype._internal_search = function () { };
7+
return Foo;
8+
}());
9+
var Bar = /** @class */ (function () {
10+
function Bar() {
11+
this._private_foo = new Foo();
12+
}
13+
Bar.prototype._internal_doSomething = function () {
14+
this._private_foo._internal_search();
15+
};
16+
return Bar;
17+
}());

0 commit comments

Comments
 (0)