Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imported string unions are set to Any #270

Closed
richardkazuomiller opened this issue Apr 28, 2020 · 0 comments
Closed

Imported string unions are set to Any #270

richardkazuomiller opened this issue Apr 28, 2020 · 0 comments
Labels
better-translation Code is translated and even useable, but can be better
Milestone

Comments

@richardkazuomiller
Copy link

Sorry if I'm doing something wrong.

If I have two files, environment.d.ts and state.d.ts with the following types

environment.d.ts

export type Environment = 'production' | 'development';

state.d.ts

import { Environment } from './state';

export interface State {
  currentEnvironment: Environment;
}

the resulting Kotlin declaration should have currentEnvironment as a string, but it is

external interface State {
    var currentEnvironment: Any
}

If I move the string union into the same file, it works

TypeScript

export type Environment = 'production' | 'development';

export interface SameFileState {
  currentEnvironment: Environment;
}

Kotlin

external interface SameFileState {
    var currentEnvironment: String /* 'production' | 'development' */
}
@Schahen Schahen added bug better-translation Code is translated and even useable, but can be better labels Apr 28, 2020
@Schahen Schahen removed the bug label May 13, 2020
@Schahen Schahen added this to the 0.5.1 milestone May 29, 2020
Schahen added a commit that referenced this issue Jun 3, 2020
@Schahen Schahen closed this as completed Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
better-translation Code is translated and even useable, but can be better
Projects
None yet
Development

No branches or pull requests

2 participants