LeoColman
06/02/2021, 8:02 PMpackage br.com.colman.dicehelper
import br.com.colman.dicehelper.br.com.colman.dicehelper.Dice
import org.antlr.runtime.ANTLRStringStream
public fun String.dice(): List<Dice> {
DiceNotationLexer(ANTLRStringStream(this))
return emptyList()
}
But the compiler warns me (via gradlew compileKotlin)
Type mismatch: inferred type is ANTLRStringStream but CharStream! was expected
ANTLRStringStream is a Java class, and it's definition is
public class ANTLRStringStream implements CharStream {
I assume that the "Type Mismatch" is wrong, as ANTLRStringStream is a CharStream, but it seems that the Kotlin compiler isn't very happy.
Does anybody know how what is going on here?LeoColman
06/02/2021, 8:03 PMLeoColman
06/02/2021, 8:04 PMDiceNotationLexer(ANTLRStringStream(this) as CharStream)
However it seems completely unnecessary.