Unity-Technologies/unityscript2csharp

missing new keyword and nullcheck

Closed this issue · 1 comments

Using 1.0.7003.16529 from command line. with -v -i -d params.

Theres a third party librarry in the plugins folder LitJson.
https://github.com/LitJSON/litjson

JS Source

#pragma strict

import LitJson;

function Start () 
{
    var jsonData : JsonData = new JsonData();
    if(jsonData)
    {

    }

}

Output

using LitJson;
using UnityEngine;
using System.Collections;

[System.Serializable]
public partial class Test_JS_LitJson : MonoBehaviour
{
    public virtual void Start()
    {
        JsonData jsonData = JsonData();
        if (jsonData)
        {
        }
    }
}

console output

Assets/Scripts/Test/Test_LitJson/Test_JS_LitJson.cs(10,29): error CS0119: Expression denotes a `type', where a `variable', `value' or `method group' was expected

Assets/Scripts/Test/Test_LitJson/Test_JS_LitJson.cs(11,9): error CS0266: Cannot implicitly convert type `LitJson.JsonData' to `bool'. An explicit conversion exists (are you missing a cast?)

I could not reproduce this with the project attached.
if you are able to reproduce, please reopen the issue, create a minimal project and attach it to the issue.

TestUS_Plugin.zip