When it refuses
Read the named refusal, keep source unchanged, and choose a safe recovery.
On this page
A refusal is a source-safety result. Round Trip found a draft or parsed shape it cannot reproduce faithfully, so it does not write an approximation.
The problem
Section titled “The problem”The .cs file stays byte-for-byte unchanged. The draft remains visible, and the compile state records failure. Repair or discard the draft, or make the edit in C# and let Round Trip reparse it.
When to reach for it
Section titled “When to reach for it”Use the refusal message to decide whether a draft is incomplete, the source has changed, or the method contains a shape that must stay source-owned. Do not work around the message by deleting code you still need.
See it
Section titled “See it”The message names the construct or declaration Round Trip declined to rewrite.
- Read the complete refusal and identify the named construct or declaration.
- Confirm that the
.csfile is unchanged. - Repair or undo an incomplete graph draft when the message names a missing input.
- For an unsupported source shape, discard the draft, right-click the node that stands for it and choose Go to Source.
- Save the C# edit and let Round Trip re-index before starting a new graph draft.
A concurrent file change reports:
{file} changed while compiling; discard and try Compile again.
A parser placeholder reports:
The method contains a construct the parser could not represent ('{placeholderReason}'), so it cannot be regenerated faithfully and was left unchanged.
Body-generation reasons
Section titled “Body-generation reasons”The internal refusal categories separate the failure stage: UnsupportedConstruct, UnsupportedStatement, PlaceholderPresent, BodyAbsent, MissingSourceMetadata, FormCannotExpressGraph, SegmentationIncomplete, ComposedTextDisagreesWithSource, HandlerStructureInvalid, CatchFilterNotComposable, HandlerBodiesUnresolvable, BranchArmsUnresolvable, BranchConditionMissing, SwitchCaseBodiesUnresolvable, and SwitchJumpTargetMissing.
The visible reason names the actual shape. Examples include:
an argument passed by parameter name,an argument marked ref, out, or in,a call to a method taking a params argument list,a lambda passed as an argument, anda generic method groupan if statement with an else block,an if statement with no condition,an assignment with no target, andan assignment with no value inputa loop built on the canvas whose body was never recorded,a loop with no condition to test, anda statement that reads a loop variable from outside the loop that declares itan array created with a size rather than a list of elements,a multi-dimensional array,a stack-allocated array,an array creation with no recorded element type, anda struct construction with an object initializera tuple with no elements,a tuple element read with no element recorded,a deconstruction with nothing to take apart, anda deconstruction nested inside another deconstructiona throw with no exception to throw,a throw used as an expression rather than a statement,an object creation with no recorded type, anda target-typed object creation ('new()' with no type written)a using statement,an unsafe block,a fixed statement,a local function declaration,a coalescing assignment (the '??=' operator),a yield return,a yield break,an await foreach loop, andan operation with a missing operand
These labels describe current whole-body writing limits. Source may still be parsed and displayed around an unsupported shape.
Declaration refusals
Section titled “Declaration refusals”Round Trip also refuses a field or enum member inside #if, or a new declaration whose insertion point would land there. It will not edit a field of a partial class when that field is declared in another file. It refuses an attribute edit on a multi-variable declaration such as int a, b;, an attribute it cannot find, or a member or type no longer present in the file.
New fields are refused in structs, records, and interfaces. A new enum cannot have a base type. Whole-enum composition is refused when members share a source line.
What it writes
Section titled “What it writes”For a refusal, it writes no replacement. This source remains unchanged:
When it goes wrong
Section titled “When it goes wrong”When it goes wrong
| Symptom | Check | Fix |
|---|---|---|
| The file changed while compiling | Compare the open draft with the newest source. | Discard the stale draft, reopen the method, and make the edit against current source. |
| A placeholder blocks body writing | Read the construct named on the placeholder. | Edit that method in C#, or remove the unsupported shape before graph authoring. |
| A declaration edit refuses | Look for conditional compilation, another partial file, shared declarations, or a missing span. | Make that declaration edit directly in C#, then wait for re-indexing. |