Open vasslitvinov opened 4 years ago
At this time we print an error message rather than crashing, but the message itself isn't ideal:
bar.chpl:1: In module 'bar':
bar.chpl:5: warning: the 'object' abstract root class has been deprecated; please use 'RootClass' instead
bar.chpl:2: error: could not determine the concrete type for the generic return type 'anymanaged object?'
We'd rather the error message say something about C
, rather than the somewhat confusing "return type" aspect.
When creating a variable of a class/record type that has a field of a generic type, the compiler needs to check that the instantiated field's type has concrete nilability and memory management. Otherwise it does not make sense and the compiler crashes, for example: