Skip to content

Hot reload fails a pulled-in file's property getter with a compile error instead of skipping it when its body no longer binds #3045

Description

@hatayama

Summary

When a reload pulls a file back in to re-bind its active patches and one of that file's existing bodies no longer binds, an ordinary method is skipped with a reason that names what to pass (#3008). A get-only property's getter in the same situation is not covered: it fails with a compile error, so the run reports a Failed row for a file the reader never passed.

Observed

In the second test of #3044 (Run_OnlyTheHostChangesTheSignatureOfTheAddedMethodANewTypeCalls_NamesItsCalls):

  1. A type introduced by hot reload calls a method that hot reload added to an existing class, from an ordinary method (Run) and from a get-only property (Answer).
  2. A later reload passes only the existing class's file and changes the added method's signature.
  3. The run pulls the new type's file back in. Run is Skipped with the sibling reason (the diagnostic is CS7036). get_Answer is Failed with CS1061.

The test pins the warning and the old body's result, not these two rows.

Where it happens

  • OrdinaryMethodQueue calls ReappliedSiblingBodyGuard.DescribeSkipOrNull for existing methods of a pulled-in file (ReappliedSibling). That call is the only use of the guard.
  • Getters take PropertyGetterEmitter.AppendPropertyGetterEntry → PropertyGetterClassifier.TrySkipPropertyGetterByDecision, which never checks ReappliedSibling, so an unbound getter body reaches the shim and fails to compile.

Expected

A getter of a pulled-in file whose body no longer binds is skipped with the same reason as a method (MethodTransformSiblingBodyUnbound, or MethodTransformSiblingBodyBindsCompiledType naming the type whose file to pass), instead of failing the run.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions