code below will reproduce it on 2151 and 2173, building for Android (on a Mac)
problem1 E258: Signature for anonymous method does not match
problem2 E486: Parameter 1 is “T1”, should be "remobjects.elements.rtl.String"
problem3 builds… but I get the .jar file issue in Android studio
Error:(57, 29) error: cannot access blah
bad class file: blah.class)
undeclared type variable: T1
Please remove or make sure it appears in the correct subdirectory of the classpath.
please note: problem1 & 2 go away if the closure parameter is not "throws"
haven’t tried 3 yet… with no throws
func xyz<S>(doParse: (String) throws -> S) -> Generic<S>
{
return Generic<S>()
}
func abc(_ s: String) -> String
{
return s
}
public func problem1() -> Generic<Int>
{
return xyz(doParse:
{
(j : String) in
return self.abc(j)
})
}
public func problem2() -> Generic<Int>
{
return xyz(doParse:
{
j in
return self.abc(j)
})
}
public func problem3() -> Generic<Int>
{
return xyz(doParse:
{
j in
return self.abc(j as! String)
})
}