Jaseci-Labs / jaseci

The Official Jaseci Code Repository
https://jaseci.org
156 stars 214 forks source link

[Bug] Syntax error with custom types in `has` declaration #1370

Open musab-mah-7 opened 1 month ago

musab-mah-7 commented 1 month ago

Describe the bug

The declaration has some: priv T; results in a syntax error when T is a custom type. However, this syntax works without issues for primitive types like int or str. This inconsistency needs to be addressed.

To Reproduce

  1. Create an object with a custom type using the has declaration.
  2. Attempt to compile or run the code.

Expected Outcome:

The syntax should be consistent, allowing custom types in the has declaration without errors.

kugesan1105 commented 1 month ago

Correct Syntax Example:

obj Shape { has :priv shape_type: ShapeType;

has :protect radius: float,
    area: float;

has name: str;

}

@musab-mah-7 https://github.com/Jaseci-Labs/jaseci/issues/1405