Skip to content

[Bug]: ownership-generic field warning not emitted without calling the constructor #27978

@DanilaFe

Description

@DanilaFe

The following program:

class C {
  var x: C;
}
var r = new C(nil);

Philosophically, this program deserves a warning for being "ownership generic". However, the warning only fires after an instantiation is created; thus, in the program above, where the new C(nil) is not a valid call due to x being non-nilable, no warning is emitted.

Associated future tests

test/classes/delete-free/ownership-generic-without-init.chpl (#27979)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions