Skip to content

Commit

Permalink
Error messages for incorrect arguments to ink fallbacks already kinda…
Browse files Browse the repository at this point in the history
… worked. Not perfect, but serviceable.
  • Loading branch information
joethephish committed Mar 10, 2016
1 parent c77e3e1 commit 2457fb5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions inklecate/ParsedHierarchy/Divert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,6 @@ public override void ResolveReferences(Story context)
runtimeDivert.pushesToStack = false;
runtimeDivert.targetPath = new Runtime.Path (this.target.firstComponent);
CheckExternalArgumentValidity (context);

// It's external, but a fallback target was found with the same name
if (targetWasFound) {
#warning TODO: Validate that fallback is a function and has the same arguments
}
}
return;
}
Expand Down Expand Up @@ -274,6 +269,8 @@ void CheckArgumentValidity()
// Can't check arguments properly. It'll be due to some
// other error though, so although there's a problem and
// we report false, we don't need to report a specific error.
// It may also be because it's a valid call to an external
// function, that we check at the resolve stage.
if (targetContent == null) {
return;
}
Expand Down Expand Up @@ -349,7 +346,7 @@ void CheckExternalArgumentValidity(Story context)
}

if (ownArgCount != externalArgCount) {
Error ("incorrect number of arguments sent to '" + externalName + "'. Expected " + externalArgCount + " but got " + ownArgCount);
Error ("incorrect number of arguments sent to external function '" + externalName + "'. Expected " + externalArgCount + " but got " + ownArgCount);
}
}

Expand Down

0 comments on commit 2457fb5

Please sign in to comment.