Skip to content

Commit

Permalink
feat: aclass as bclass
Browse files Browse the repository at this point in the history
  • Loading branch information
meixg committed Oct 28, 2019
1 parent 3f3c6b1 commit 2e9d443
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1785,8 +1785,7 @@ export function emitFile(
return;
}

let symbol = typeChecker.getSymbolAtLocation(item);
if (symbol && symbol.flags === ts.SymbolFlags.Class) {
if (isClassLike(item, typeChecker)) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion test/features/Class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import {Base} from '../some-utils';
import {SomeType} from '../some-types';

class Article extends Base {
export class Article extends Base {

public title: string;
id: number;
Expand Down
3 changes: 3 additions & 0 deletions test/features/inheritedVariables.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php
namespace test\case_inheritedVariables;
require_once(dirname(__FILE__) . '/' . "./Class.php");
use \Article as Art;
$a = array(
"b" => "123456"
);
Expand Down Expand Up @@ -44,5 +46,6 @@ class nnn {
}
$arr4 = array_map(function ($item) {
$c = new nnn();
$d = new Art(array( "title" => "" ));
return mmm::func($item);
}, $arr);
2 changes: 2 additions & 0 deletions test/features/inheritedVariables.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Article as Art} from './Class';
let a = {
b: '123456'
};
Expand Down Expand Up @@ -60,5 +61,6 @@ class nnn {}

let arr4 = arr.map(item => {
let c = new nnn();
let d = new Art({title: ''});
return mmm.func(item);
});

0 comments on commit 2e9d443

Please sign in to comment.