@Test
public void test_types() throws IOException
{
compile("types_param.js");
ClassReference reference = model.getClassReference("Foo");
JSType jsType1 = getJSType("test1", true, "arg1");
JSType jsType2 = getJSType("test2", true, "arg1");
JSType jsType3 = getJSType("test3", true, "arg1");
JSType jsType4 = getJSType("test4", true, "arg1");
JSType jsType5 = getJSType("test5", true, "arg1");
JSType jsType6 = getJSType("test6", true, "arg1");
assertTrue(jsType1.isString());
assertTrue(jsType2.isUnionType());
assertTrue(jsType3.isRecordType());
assertTrue(jsType4.isUnionType());
assertTrue(jsType5.isInstanceType());
assertTrue(jsType6.isFunctionType());
assertEquals("String",
JSTypeUtils.toParamTypeString(reference.getStaticMethod("test1"), "arg1"));
assertEquals("foo.bar.Baz",
JSTypeUtils.toParamTypeString(reference.getStaticMethod("test2"), "arg1"));
assertEquals("Object /* {myNum: number, myObject: ?} */",
JSTypeUtils.toParamTypeString(reference.getStaticMethod("test3"), "arg1"));
assertEquals("Number",
JSTypeUtils.toParamTypeString(reference.getStaticMethod("test4"), "arg1"));
assertEquals("Object",
JSTypeUtils.toParamTypeString(reference.getStaticMethod("test5"), "arg1"));
assertEquals("Function /* function(string, boolean): ? */",
JSTypeUtils.toParamTypeString(reference.getStaticMethod("test6"), "arg1"));
}