Klitos Kyriacou04/14/2022, 8:38 AM
The error is:
val sqlServerDataSource = SQLServerDataSource() sqlServerDataSource.url = myUrl sqlServerDataSource.user = myUser sqlServerDataSource.password = myPassword
There is no error on url or user; only on password. If I replace it with
Cannot access 'password': it is public/*package*/ for synthetic extension in '<library Maven: com.microsoft.sqlserver:mssql-jdbc:10.2.0.jre17>'
it works. But why can't I use the property syntax, and what exactly does the error message mean, and why only password has this error?
but only a package-private
public void setPassword(String password)
. This prevents Kotlin from synthesizing a
property. Is this intentional, or is it a bug?
Michael de Kaste04/14/2022, 9:24 AM
Vampire04/14/2022, 9:26 AM
Note that, if the Java class only has a setter, it isn't visible as a property in Kotlin because Kotlin doesn't support set-only properties.
ephemient04/14/2022, 10:21 AM