crystal
crystal copied to clipboard
The Crystal Programming Language
The following code crashes the compiler: ```Crystal lib LibFoo struct Struct payload : Void* end end io = IO::Memory.new("hey") a = LibFoo::Struct.new a.payload = pointerof(io) ``` ``` Module validation failed:...
This patch provides Natvis formatter definitions for `String`, `Array`, and `Hash`:  Without the formatters:  System-wide Natvis files are only suitable for languages supported by Visual Studio itself, and...
## Bug Report When preparing for my next release of the `kube-client.cr` i am unable to run `crystal spec` in github actions due to the following error: ``` cc: error:...
## Feature Request Given this code: ```crystal def method_that_only_returns_nil : Nil # literally anything end def success! end if method_that_only_returns_nil success! end ``` Checking for truthiness of the return value...
Fixes #7340. A "complex expression" is anything that isn't a `Nop`, `NilLiteral`, `BoolLiteral`, `NumberLiteral`, `CharLiteral`, `StringLiteral`, `SymbolLiteral`, `Var`, `InstanceVar`, or `ClassVar`. (This same criterion is used by the normalizer to...
This ensures that macro interpolation and other things do not produce invalid code from a `LibDef`, since empty parameters are actually allowed for lib funs: ```crystal macro foo(x) {% p...
In the following snippet, the `Bar` in `x : Bar` is resolved as a type even though it is a free variable, and since `Bar < Foo`, the `Bar` overload...
This PR moves all the warning settings and detected warnings into a new `Crystal::WarningCollection` object. A new `Crystal::Compiler` or `Crystal::Program` comes with its own warning collection, but a collection may...
Fixes #12361. The full list of affected nodes are: ```crystal macro show(x) {% p x %} {% puts "" %} end show(if 1; begin; 2; end; else; begin; 3; end;...
This companion to #12353 makes `TypeNode#nilable?` return `true` for all supertypes of `Nil`: ```crystal {{ Value.nilable? }} # => true {{ Object.nilable? }} # => true module Foo; end struct...