Skip to content

Verify @Child fields that use @Instrumentable nodes with an annotation processor. #66

@chumer

Description

@chumer

It is a common error in guest languages to use nodes with source sections and that are @Instrumentable with the wrong field type so that the WrapperNode cannot get inserted.

For example:

@Instrumentable(InstrumentableNodeWrapper.class)
class InstrumentableNode extends Node {}

class InstrumentableNodeSubclass extends InstrumentableNode {}

class SomeOtherNode {
@Child InstrumentableNodeSubclass child;
}

Replaces on SomeOtherNode#child will fail if InstrumentableNodeSubclass is wrapped by the instrumentation framework because the wrapper just extends InstrumentableNode but not as required InstrumentableNodeSubclass. We should check for this error in an annotation processor that gets triggered on @child annotations.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions