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

Lint/UselessAssign when using generics #446

Closed
Blacksmoke16 opened this issue Jan 15, 2024 · 9 comments · Fixed by #449
Closed

Lint/UselessAssign when using generics #446

Blacksmoke16 opened this issue Jan 15, 2024 · 9 comments · Fixed by #449
Assignees
Milestone

Comments

@Blacksmoke16
Copy link
Contributor

record Foo(T), id : T
[W] Lint/UselessAssign: Useless assignment to variable `id`
> record Foo(T), id : T
@Sija
Copy link
Member

Sija commented Jan 15, 2024

Cannot reproduce, are you sure you're using the latest ameba version?

@Blacksmoke16
Copy link
Contributor Author

Yes:

# NOTICE: This lockfile contains some overrides from shard.dev.yml
version: 2.0
shards:
  ameba:
    git: https://github.com/crystal-ameba/ameba.git
    version: 1.6.1+git.commit.b56d34715de61b6674e02e85affe3124a22fb418

@Sija
Copy link
Member

Sija commented Jan 15, 2024

And this snippet alone reproduces the issue for you?

@Blacksmoke16
Copy link
Contributor Author

Blacksmoke16 commented Jan 15, 2024

Yes:

$ cat test.cr 
record Foo(T), id : T

$ ./bin/ameba test.cr 
Inspecting 1 file

F

test.cr:1:16
[W] Lint/UselessAssign: Useless assignment to variable `id`
> record Foo(T), id : T
                 ^----^

Finished in 21.16 milliseconds
1 inspected, 1 failure

@Sija
Copy link
Member

Sija commented Jan 15, 2024

Cannot reproduce, that's very weird 🤔

@Blacksmoke16
Copy link
Contributor Author

I can clone master, make, and run the file and still fails:

$ crystal --version
Crystal 1.10.1 (2023-10-25)

LLVM: 16.0.6
Default target: x86_64-pc-linux-gnu

@Sija
Copy link
Member

Sija commented Jan 16, 2024

While running make I'm getting:

make: Nothing to be done for `all'.

Probably has sth to do with #445 /cc @straight-shoota

I've been able to reproduce it though.

@Blacksmoke16
Copy link
Contributor Author

Well just run make clean all and that'll rebuild it fresh.

@Sija
Copy link
Member

Sija commented Jan 16, 2024

@Blacksmoke16 Tried that, same thing :(

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

Successfully merging a pull request may close this issue.

2 participants