#1836 Expected identifier, not '('

Pueo Wed 14 Mar 2012

I'm getting error (57,19) Expected identifier, not "(" when I try to compile my pod.

Code:

comment
etc
blah blah
comment
using statement*7
etc

class Main
{
  public Void main()
  {
    echo("hi")
  }

  public TermPanel(int columns, int rows, int fontSize) //This is line 57    
  {
    columns := 142
    rows := 34
    fontSize := 16
  }

  public World(int width, int height)
  {
    width := 127
    height := 25
  }

}

What's the problem?

andy Wed 14 Mar 2012

Need to make your int -> Int

Primitives are real objects in Fantom.

brian Wed 14 Mar 2012

This line here:

public TermPanel(int columns, int rows, int fontSize)

Has two problems:

  • missing a return type
  • int should be Int

So probably want something like this:

Void termPanel(Int columns, Int rows, Int fontSize)
{
}

ikhwanhayat Wed 14 Mar 2012

If you intend TermPanel as a method in class Main, then you are missing out the return type. Maybe you meant public Void TermPanel(...).

If you intend it to be a class, than you should declare it as a class, outside of class Main.

Pueo Wed 14 Mar 2012

Ok, so add Void, int as Int, and it runs. Thanks a lot!

Login or Signup to reply.