Boo

Non-null type T!

Details

  • Type: New Feature New Feature
  • Status: In Progress In Progress
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 0.8.1
  • Fix Version/s: 0.9.5
  • Component/s: None
  • Labels:
    None
  • Testcase included:
    yes
  • Number of attachments :
    0

Description

Ala Spec#, T! makes the compiler output error or warning when null is or may be used where a non-null value is expected.

For instance :

def Parse(s as string!):
    pass

x as string
Parse(x) #ERROR: Null cannot be used where a non-null value is expected.

x = SomeExternalMethod()
Parse(x) #WARNING: Null may be used where a non-null value is expected.

Issue Links

Activity

Hide
James Bellinger added a comment -

Hmm. This would be a great feature for debugging.

In the external method case, it might become laborious to manually check for null when you know it is, however. Perhaps it could also include the functionality of [required] to check the same at runtime?

Show
James Bellinger added a comment - Hmm. This would be a great feature for debugging. In the external method case, it might become laborious to manually check for null when you know it is, however. Perhaps it could also include the functionality of [required] to check the same at runtime?

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: