-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Declaration files error for function return types #25685
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
Comments
Can you see if this occurs in the nightlies or 3.0 RC? Run the following for nightlies.
|
Afaik, you shouldn't set |
@weswigham I am using baseUrl because it apparently is required to run tsc. |
...? How so? |
Oh, right, we require it be present when using |
@weswigham I'm not entirly sure what you mean but I'll give it a go and post back the result. Thanks |
@weswigham I've encountered what seems to be a different manifestation of the same bug. Code: // file: bug_f1.ts
export type type1 = { a: string }
export type type2 = { b: number }
export type combinedType = type1 | type2 //file: bug_f2.ts
import { combinedType } from "./bug_f1"
export function f2(param1: combinedType = { a: "" }, param2: string): combinedType {
return param1
} // tsconfig.json
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@src/*": ["src/*"]
},
"rootDir": "src",
"outDir": "dist.tmp",
"strict": true,
"declaration": true
}
} Expected Behavior: import { combinedType } from "./bug_f1";
export declare function f2(param1: combinedType, param2: string): combinedType; or at least: import { combinedType } from "./bug_f1";
export declare function f2(param1: import("./bug_f1").type1 | import("./bug_f1").type2 | undefined, param2: string): combinedType; Actual Behavior: import { combinedType } from "./bug_f1";
export declare function f2(param1: import("@src/bug_f1").type1 | import("@src/bug_f1").type2 | undefined, param2: string): combinedType; Changing strict to false causes bug_f2.d.ts to take on the first form (i.e., param1: combinedType). I saw this happening with 2.9.1, 2.9.2, 3.1.0-dev.20180809 |
TypeScript Version: 2.9.2
Search Terms: declaration file inline import, declaration files import path error
Code
In src/lib/operators/scalar.ts
In src/settings/spacing.ts
Expected behavior:
In dist/settings/spacing.d.ts
Actual behavior:
In dist/settings/spacing.d.ts
NOTES:
Local tsconfig.json
Main tsconfig.json
The text was updated successfully, but these errors were encountered: