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

Parser errors for some var functions #521

Closed
winmain opened this issue Nov 21, 2016 · 3 comments
Closed

Parser errors for some var functions #521

winmain opened this issue Nov 21, 2016 · 3 comments

Comments

@winmain
Copy link
Contributor

winmain commented Nov 21, 2016

image

fn1 brokes when var declares a function with Void arguments. Any other argument type works fine.

fn2 brokes everything below when function declared without curly braces. Workaround here is to use function with body declared in curly braces, for example: function() {return 5;}

class Test {

  var fn1: Void -> Void = function(): Void {}; // Incompatible type error for Void argument functions

  var fn2: Void -> Int = function() return 5;

  public static function main(): Void { // "public" unexpected after var with short function
  }
}

Plugin version: 0.10.1-RC2
Idea: 2016.2

@mayakwd
Copy link
Contributor

mayakwd commented Sep 26, 2017

var fn2: Void -> Int = function() return 5;

public static function main(): Void { // "public" unexpected after var with short function

This block is parsing incorrectly because fn2 is awaiting for closing semicolon, existing semicolon is belongs to returnStatement (from functionCommonBody)

@EricBishton
Copy link
Member

The fn1 error was fixed by @mayakwd's submission. Only fn2 left...

@EricBishton
Copy link
Member

fn2 was fixed at some point during 0.11.2 release cycle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants