Kotlin / dukat

Converter of <any kind of declarations> to Kotlin external declarations
552 stars 42 forks source link

Illegal dynamic TypeAlias occurs under specific circumstances #372

Closed Schahen closed 4 years ago

Schahen commented 4 years ago

Following code

declare namespace Search {
  type MetadataSettings = Settings.Param;

  namespace Settings {
    type Param = (Pick<_Impl, 'cache'> |
      Pick<_Impl, 'results'>) &
      Partial<Pick<_Impl, keyof _Impl>>;

    interface _Impl {
      cache: string;
      results: string;
    }
  }
}

is translated to:

// [test] nonDeclarations.Search.kt

typealias MetadataSettings = dynamic

// ------------------------------------------------------------------------------------------
// [test] aaa.Search.Settings.kt
package Search.Settings

external interface _Impl {
    var cache: String
    var results: String
}

While actually we expect typealias to be gone completely