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

Unused generic type causing compilation error #511

Closed
peterreisz opened this issue Jul 20, 2020 · 5 comments
Closed

Unused generic type causing compilation error #511

peterreisz opened this issue Jul 20, 2020 · 5 comments
Labels

Comments

@peterreisz
Copy link

I'm trying to use a newer version of Rambda with a strict ts-config in an angular project and I've got this compilation error:

ERROR: node_modules/rambda/_ts-toolbelt/src/Iteration/Format.ts:23:62 - error TS6133: 'IMap' is declared but its value is never read.

23 export type Format<I extends Iteration, fmt extends Formats, IMap extends Map = NumberMap> = {
                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Had to go back to version 5.5

@selfrefactor
Copy link
Owner

Thank you for reporting this bug.

Can you share link to the Angular project or the strict config as I can see the bug for myself?

@peterreisz
Copy link
Author

It's a proprietary project which I cannot share, but you can try it on a minimum project without angular too:

package.json

{
  "name": "rambda-test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "typescript": "^3.9.7"
  },
  "dependencies": {
    "rambda": "^5.9.0"
  }
}

tsconfig.json

{
    "compilerOptions": {
        "noUnusedLocals": true,
        "noUnusedParameters": true
    },
    "files": ["test.ts"]
}

test.ts

import { defaultTo } from 'rambda';

console.log(defaultTo('foo', undefined));

build it with: npx tsc

@selfrefactor
Copy link
Owner

selfrefactor commented Jul 23, 2020

Thank you - that is sufficient info. I managed to reproduce it and I opened issue with TS-toolbelt library as the problem comes from there: millsp/ts-toolbelt#133

@selfrefactor
Copy link
Owner

So ts-toolbelt fixed this issue, but later commits brake it again. I had to allow to connect Rambda to specific commit of ts-toolbelt and I can claim that the issue is fixed. Expect it with upcoming 5.10.0 version.

@selfrefactor
Copy link
Owner

I am closing this issue as the fix is published with version 5.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants