Skip to content

Bug: this type supports the "null" value #2

Open

Description

@dsyme

The "Nothing" type supports the "null" value in addition to the "Instance" value. That's a bug. Please update your programming language to make sure that it doesn't permit null values of this type under normal use. Do not close this issue until you have successfully done this.

Activity

  1. pavel-khritonenko commented on Mar 7, 2015

    @pavel-khritonenko

    It should be struct instead of class

  2. tpetricek commented on Mar 8, 2015

    @tpetricek

    Right! As things stand, having two possible values, the so-called type "nothing" is actually equivalent to "Boolean"!

  3. Daniel15 commented on Mar 8, 2015

    @Daniel15
    public class AwesomeBoolean
    {
        public Nothing True { get { return Nothing.Instance; } }
        public Nothing False { get { return null; } }
    }
    
  4. gregoryyoung commented on Mar 8, 2015

    @gregoryyoung
    Owner

    LOL!

    On Sun, Mar 8, 2015 at 8:57 AM, Daniel Lo Nigro notifications@github.com
    wrote:

    public class AwesomeBoolean
    {
    public Nothing True { get { return Nothing.Instance(); } }
    public Nothing False { get { return null; } }
    }

    —
    Reply to this email directly or view it on GitHub
    #2 (comment).

    Studying for the Turing test

  5. dsyme commented on Mar 9, 2015

    @dsyme
    Author

    The proposed fix (also the one adding "sealed") means we can no longer inherit from Nothing.

    It seems clear that each and every thing "is a" nothing - maximum flexibility requires an open universe of possibilities (see also #24 (comment)).

    Further, inheriting a hidden something from Nothing is a well known tax avoidance strategy in some jurisdictions.

  6. reopened this on Mar 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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