cx icon indicating copy to clipboard operation
cx copied to clipboard

Compiler Error: funcs can be called without parentheses....

Open corpusc opened this issue 5 years ago • 1 comments

....when the func lives in a package, and is called with package prefix (from outside package).

To Reproduce

The quickest way to verify this would be to go into the "cx-games" repo at "github.com\skycoin\cx-games\issues\136" and run the 2 files there with "cx ." but you can alternatively do the following 3 steps:

  1. put the following code in your main file:

package main import "pkg"

func main () { pkg.FuncInPkg }

  1. put the following code in a file named "pkg":

package pkg

func FuncInPkg () { str.print("FuncInPkg called WITH NO PARENTHESES") }

  1. see that the function calls without raising an error

Expected behavior Some kind of error or at least a warning that you didn't use parentheses.

Desktop:

  • OS: Windows 10
  • CX Version 0.7.0

corpusc avatar Dec 29 '19 09:12 corpusc

Also parser error, should reject

SkycoinSynth avatar Feb 04 '21 10:02 SkycoinSynth