inkle / inkle/ink

Compiler crashes when using a dynamic divert that expects a parameter

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

Description

Minimum reproduction

```ink
-> Call(-> Lambda)

=== Call(->lambda)
~lambda()
-> DONE

=== Lambda(a)
-> DONE
```

Error

```cs
System.Exception: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index') (Internal story path: Lambda.0)
---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Ink.Runtime.StoryState.PopEvaluationStack() in /Users/phish/inkle/projects/ink/ink-engine-runtime/StoryState.cs:line 1156
at Ink.Runtime.Story.PerformLogicAndFlowControl(Object contentObj) in /Users/phish/inkle/projects/ink/ink-engine-runtime/Story.cs:line 1661
at Ink.Runtime.Story.Step() in /Users/phish/inkle/projects/ink/ink-engine-runtime/Story.cs:line 910
at Ink.Runtime.Story.ContinueSingleStep() in /Users/phish/inkle/projects/ink/ink-engine-runtime/Story.cs:line 596
at Ink.Runtime.Story.ContinueInternal(Single millisecsLimitAsync) in /Users/phish/inkle/projects/ink/ink-engine-runtime/Story.cs:line 467
at Ink.CommandLinePlayer.EvaluateStory()
at Ink.CommandLinePlayer.Begin()
at Ink.CommandLineTool..ctor(String[] args)
--- End of inner exception stack trace ---
at Ink.CommandLineTool..ctor(String[] args)
at Ink.CommandLineTool.Main(String[] args)
```

Versions:

Inky version: 0.15.1

ink version: 1.2.0

inkjs version: 2.2.3

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.