8000 Treats an out of bounds access for an object sequence as truthy · Issue #11 · mattaylor/elvis · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Treats an out of bounds access for an object sequence as truthy #11
Open
@ajusa

Description

@ajusa

Not quite sure what is going on, but I do have a minimal reproducible example:

import elvis

var a: seq[int] = @[]
echo ?(a[0])

type Story* = object
var stories: seq[Story]
echo ?(stories[0])

This prints

false
true

which is pretty counter intuitive, as I'd expect the second echo to print false as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0