Skip to content

"Error: invalid type: 'auto' in this context: 'any' for var" while running readme's example #1

@pietroppeter

Description

@pietroppeter

Using the example in the readme:

import p5

proc newColor(): Color =
  let
    r = random() * 255
    g = random() * 255
    b = random() * 255
    
  result = color(r, g, b)

proc setup() {.exportc.} =
  createCanvas(500, 500)
  frameRate(3)
  
proc draw() {.exportc.} =
  background(newColor())

and compiling with nim js, an error is thrown:

.nimble\pkgs\nimp5-0.1.0\p5.nim(90, 5) Error: invalid type: 'auto' in this context: 'any' for var

see https://github.com/Foldover/nim-p5/blob/master/src/p5.nim#L90

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions