Comments (12)
The base issue is the same as #366 though: SeverityYamlConverter.from_yaml
returns Severity?
and that value is assigned to a variable of type Severity
.
This worked before only because the Nil
type was silently ignored (an actual nil
value would've caused a runtime exception).
This error now appears since crystal-lang/crystal#13433 regardless of the fix in #366 because it affects a different location.
For some reason this code path was previously not touched by the changes to JSON::Serializable
in 1.8.x.
To resolve this, the return type of SeverityYamlConverter.from_yaml
needs to be assignable to the instance variable. It's probably best to drop the Nil
type and raise directly in the converter.
from ameba.
Most likely a duplicate of #366
@mamantoha Could you please check if the version from master
works for you?
from ameba.
Test on 1.5.0, it works, thank you!
from ameba.
Yes, this is literally the same error message as #371. It should not only appear with Crystal nightly but since 1.8.0.
from ameba.
@straight-shoota There's no error for Crystal 1.8.2.
from ameba.
@straight-shoota Also, the #366 fixed the type in the specs, and not in the main application code.
from ameba.
@Sija @straight-shoota I checked this on master
.
No issue on Crystal 1.8.1
Crystal 1.8.1 [a59a3dbd7] (2023-04-20)
LLVM: 15.0.7
Default target: x86_64-unknown-linux-gnu
Additionally, I updated the Crystal snap from the edge channel and the error no longer appears.
crystal -v
Crystal 1.8.2 [7aa5cdd86] (2023-05-09)
LLVM: 15.0.7
Default target: x86_64-unknown-linux-gnu
from ameba.
Interesting... perhaps an edge-case regression?
from ameba.
Perhaps. If the issue reappears, I will reopen the ticket.
from ameba.
@straight-shoota The issue still persists with Crystal 1.9.0-dev, so sth seems broken there...
from ameba.
I have confirmed the issue on the Crystal master
branch by testing it with CRYSTAL_PATH
. Setting the CRYSTAL_PATH
to /path/to/crystal/src:lib
and running crystal spec
resulted in the same error as described in the ticket.
from ameba.
@mamantoha Could you try ameba's master
branch?
from ameba.
Related Issues (20)
- warn on redundant use of `.try` HOT 3
- Recognize unused variable from type declaration HOT 2
- ComparisonToBoolean with Bool unions HOT 2
- exception names are too limited HOT 7
- A dedicated `rules` command HOT 1
- `Lint/UselessAssign` reports type declarations within `lib` definitions
- Add lsp server option HOT 1
- `Lint/UselessAssign` when using generics HOT 9
- `Lint/UselessAssign` reports macros accepting `Crystal::Macros::TypeDeclaration` HOT 16
- Avoid annoyance from new rules HOT 4
- Naming/BlockParameterName + stdlib methods like sort HOT 4
- spec helpers getting flagged HOT 1
- Custom macro generates "Useless assignment to variable" HOT 3
- Naming/BlockParameterName with ignored names HOT 1
- Ameba trips on folder named `*.cr`
- [Feature Request] Unused `rescue` variable name
- [Feature Request] Lint against accessing instance variables outside of the instance of a class HOT 4
- ameba no longer works in WSL
- Add rule enforcing explicit return HOT 5
- False positive `Lint/UselessAssign`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ameba.