Hi.
I have a interface like this:
interface displayName="AI File Service Interface" hint="Defines the contract for AI file service operations." {
/**
* Uploads a file to the AI provider's file storage.
* @return DTO representing the uploaded file (e.g., ai_services.gemini.dto.GeminiFile or ai_services.openai.dto.OpenAIFile).
*/
public any function uploadFile(
required string filePath,
string displayName,
numeric maxWaitSeconds
);
/**
* Retrieves metadata for a specific file.
* @return DTO representing the file.
*/
public any function getFile(required string fileId);
/**
* Lists files stored with the AI provider.
* @return Struct with 'files' (array of file DTOs) and 'nextPageToken'.
*/
public struct function listFiles(
numeric pageSize,
string pageToken,
boolean fetchAllPages
);
/**
* Deletes a file from the AI provider's storage.
* @return Boolean success.
*/
public boolean function deleteFile(required string fileId);
}
When i try to implent in an component like this:
public ai_services.gemini.dto.GeminiFile function uploadFile(
required string filePath,
string displayName = '',
numeric maxWaitSeconds = 60
) {
....
I get a return type [ai_services.gemini.dto.GeminiFile] does not match the abstract component/interface function return type [any]
error. If i change
the return type to any it works.
According to Coldfusion docs, it support Covariance. Lucee suports it?
Don’t forget to tell us about your stack!
OS: ???
Java Version: ???
Tomcat Version: ???
Lucee Version: 6.latest