Skip to content
This repository was archived by the owner on Nov 6, 2019. It is now read-only.

Commit ebb88bf

Browse files
committed
Don't crash on construct signatures (new) inside type literals
Fix for #72
1 parent 948088c commit ebb88bf

File tree

5 files changed

+23
-0
lines changed

5 files changed

+23
-0
lines changed

src/converter/TsClassifierToKt.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,8 @@ abstract class TsClassifierToKt(
122122
addFunction(null, INVOKE, callSignature, needsNoImpl = false, additionalAnnotations = listOf(NATIVE_INVOKE_ANNOTATION), isOperator = true)
123123
}
124124
}
125+
126+
override fun visitConstructSignatureDeclaration(node: ConstructorDeclaration) {
127+
// TODO: support
128+
}
125129
}

testData/new/inTypeLiteral.d.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package inTypeLiteral
2+
3+
external interface Foo
4+
external object foo {
5+
}

testData/new/inTypeLiteral.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
interface Foo {}
2+
3+
declare var foo : {
4+
new(): Foo;
5+
};

testData/new/simple.d.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package simple
2+
3+
external interface Foo
4+
external interface Bar

testData/new/simple.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
declare interface Foo {
2+
new(): Bar
3+
}
4+
5+
interface Bar {}

0 commit comments

Comments
 (0)