Skip to content

Commit

Permalink
Merge pull request #2594 from FirelyTeam/fix/add_check_on_definition_…
Browse files Browse the repository at this point in the history
…when_visiting

VONK-5300 Accessing the Definition when visiting all descendants of a ITypedElement
  • Loading branch information
mmsmits authored Mar 21, 2024
2 parents bd07ced + 84b18cf commit 3e54cec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Hl7.Fhir.Base/ElementModel/ElementNodeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ private static void visit(this ITypedElement root, Action<int, ITypedElement> vi
public static IDisposable Catch(this ITypedElement source, ExceptionNotificationHandler handler) =>
source is IExceptionSource s ? s.Catch(handler) : throw new NotImplementedException("Element does not implement IExceptionSource.");

public static void VisitAll(this ITypedElement nav) => nav.Visit((_, n) => { var dummy = n.Value; });
public static void VisitAll(this ITypedElement nav) => nav.Visit((_, n) =>
{
var dummyValue = n.Value;
var dummyDefinition = n.Definition;
});

public static List<ExceptionNotification> VisitAndCatch(this ITypedElement node)
{
Expand Down

0 comments on commit 3e54cec

Please sign in to comment.