dukat icon indicating copy to clipboard operation
dukat copied to clipboard

Fail to compile code with eponymous typealias

Open Schahen opened this issue 5 years ago • 0 comments

This one is very close to #251 but still I need check that reasons are exactly the same (I mean, it looks like this but nevertheless)

import * as PropTypes from "_proptypes";

type Requireable<T> = PropTypes.Requireable<T>

declare function generateRequirable(): Requireable<string>;

will be translated to

typealias Requireable<T> = Requireable<T>

external fun generateRequirable(): Requireable<String>

which will fail to compile with following error:

 error: redeclaration: Requireable
typealias Requireable<T> = Requireable<T>

The reason is obvious - we can not tell apart symbols with same fqName if they belong to the same module (well, their fqName would be identical) - that actually makes this fqNames, well, not fully qualified :)

Schahen avatar Apr 07 '20 16:04 Schahen