inkle / inkle/ink

Bug: Divert target variable declaration order

Open
#155 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
4.9k
Forks
540
PR merge metrics
No merged PRs in 30d

Description

First of all, let me just say that I have been using Ink for the past couple of days and it is beyond amazing. Thank you so much for sharing this great project with the community.

I recently ran into what I believe is a bug with divert target variables.

```
=== top_knot ===
Herein, I test divert targets.
-> _MyDivertTarget

=== diversion ===
What a nice diversion!
->END

VAR _MyDivertTarget = -> diversion
```

This code fails to compile, with the error message "Divert target not found: '-> _MyDivertTarget.' By messing around with the this, I was able to get the following to compile:

```
-> top_knot

VAR _MyDivertTarget = -> diversion

=== top_knot ===
Herein, I test divert targets.
-> _MyDivertTarget

=== diversion ===
What a nice diversion!
->END
```

I don't believe this is the expected behavior, since I've found that otherwise, the order of varaible declaration doesn't matter. Along the same lines, if I print the value of _MyDivertTarget in the first example without trying to divert to it, it says "debug DivertTargetValue(diversion)" - so it recognizes the variable in one context, but as soon as I try to actually divert to it, the compiler throws an error.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.