Skip to content

we should not deny assigning, passing, and returning void type #775

@f-ckAndroid

Description

@f-ckAndroid
  • issue:
    in bsh, we can't assign and pass void type.
    in javascript, we can do:
    var foo = undefined // to delete foo
    var foo = this.aNonExistionVar // allow
    var foo = doSth(); // may return undefined

    var foo = aNonExistionVar // NOT allow, special case.

    bar(foo); // foo is undefined
    bar(getFoo()) // allow undefined
    IMHO: bsh should have those behaviors like js, because void and undefined are all useful types.
    let implementers decide whether to raise an exception or not,

  • solvetion:
    IMHO: we should remove all checking for Primitive.VOID in all classes, we just throw an exception when unwrap a void object.
    we may also edit the Name.java for the special case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions