Skip to content

Disallow 'bool' type in .trb files - enforce 'Boolean' only #16

@yhk1038

Description

@yhk1038

Summary

Currently, both bool and Boolean are accepted in .trb source files. For consistency, we should only allow Boolean in user-facing .trb files.

Current Behavior

# Both work currently
def is_valid(): bool    # Should error
def is_valid(): Boolean # Correct

Expected Behavior

  • .trb files: Only Boolean should be valid
  • .rbs output: Compiler converts Booleanbool (RBS standard)

Context

  • Boolean is defined in T-Ruby stdlib as type Boolean = true | false
  • RBS standard uses lowercase bool
  • TypeScript uses lowercase boolean, but T-Ruby follows Ruby naming conventions (PascalCase for types)

Implementation Options

  1. Parser level: Reject bool during type annotation parsing
  2. Type checker level: Add bool to list of unknown/invalid types

Related

  • Documentation already uses Boolean consistently
  • Test code updated to use Boolean in .trb examples

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