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

No overload matches StaticArray #1203

Closed
stugol opened this issue Aug 17, 2015 · 4 comments
Closed

No overload matches StaticArray #1203

stugol opened this issue Aug 17, 2015 · 4 comments
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler

Comments

@stugol
Copy link

stugol commented Aug 17, 2015

The code at http://play.crystal-lang.org/#/r/bm0 causes no overload matches 'fn' with types StaticArray(Int32, 10)

@jhass
Copy link
Member

jhass commented Aug 17, 2015

Related to #934

@asterite
Copy link
Member

I think the N might not be matching there, but it should.

@asterite asterite added the kind:bug A bug in the code. Does not apply to documentation, specs, etc. label Aug 19, 2015
@miketheman
Copy link
Contributor

#triage

This was reported against Crystal 0.7.6.

Running this code against 0.16.0 produces a Syntax error on the double-colon: https://play.crystal-lang.org/#/r/yfc
The :: notation was removed circa 0.12.0, notably in 2367653

Replacing the :: with a single : produces: https://play.crystal-lang.org/#/r/yfd

declaring the type of a local variable is not yet supported

This message is located in 3 locations:

spec/compiler/type_inference/instance_var_spec.cr
3032:      "declaring the type of a local variable is not yet supported"
src/compiler/crystal/semantic/main_visitor.cr
169:        node.raise "declaring the type of a local variable is not yet supported"
src/compiler/crystal/semantic/type_declaration_visitor.cr
107:        node.raise "declaring the type of a local variable is not yet supported"

making it a little more difficult in tracing exactly which one is being triggered.

@jhass
Copy link
Member

jhass commented May 14, 2016

This usecase of :: got replaced with uninitialized: https://play.crystal-lang.org/#/r/yfu

keplersj added a commit to keplersj/crystal that referenced this issue May 21, 2016
* master: (69 commits)
  Fixed: splat restriction and double splat restriction didn't match empty tuple/named-tuple
  Fixed crystal-lang#1203: allow using free var to match the size of a static array
  Updated Changelog
  Compiler: don't remove old directories when compiling macro run programs. Related to crystal-lang#2625
  Fixed crystal-lang#2624: Running multiple macro runs doesn't work
  Docker: Preinstall git in released docker image
  Update and fix TypeNode macro method docs
  Fixed wrong datatype in 0.17 branch
  Docs: use `*` and `**` before type argument for Tuple and NamedTuple
  Docs: use `*` and `**` before type argument for Tuple and NamedTuple
  Compiler: allow a double splat restriction on a double splat argument
  Compiler: allow a splat restriction on a splat argument
  Compiler: allow restriction in double splat
  Compiler: guess type from captured block without restriction
  Fixed crystal-lang#731: initialize's default arguments are incorrectly evaluated at the class scope
  Fixed crystal-lang#2619: wrong codegen for global variable assignment in type declaration
  Compiler: allow a double splat restriction on a double splat argument
  Compiler: allow a splat restriction on a splat argument
  Compiler: allow restriction in double splat
  Compiler: guess type from captured block without restriction
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler
Projects
None yet
Development

No branches or pull requests

4 participants