Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Commit

Permalink
Add errors for using the is and as keywords
Browse files Browse the repository at this point in the history
- Add errors for using the `is` and `as` keywords because Udon does not currently expose the System.Type methods needed to implement them.
  • Loading branch information
MerlinVR committed Apr 10, 2020
1 parent 93b1ed0 commit fc2f279
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Assets/UdonSharp/Editor/UdonSharpASTVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1553,6 +1553,12 @@ public override void VisitBinaryExpression(BinaryExpressionSyntax node)
{
UpdateSyntaxNode(node);

if (node.Kind() == SyntaxKind.IsExpression)
throw new System.NotSupportedException("The `is` keyword is not yet supported by UdonSharp since Udon does not expose what is necessary (https://vrchat.canny.io/vrchat-udon-closed-alpha-feedback/p/expose-systemtypeissubclassof-isinstanceoftype-issubclassof-and-basetype)");

if (node.Kind() == SyntaxKind.AsExpression)
throw new System.NotSupportedException("The `as` keyword is not yet supported by UdonSharp since Udon does not expose what is necessary (https://vrchat.canny.io/vrchat-udon-closed-alpha-feedback/p/expose-systemtypeissubclassof-isinstanceoftype-issubclassof-and-basetype)");

if (node.Kind() == SyntaxKind.LogicalAndExpression || node.Kind() == SyntaxKind.LogicalOrExpression)
{
HandleBinaryShortCircuitConditional(node);
Expand Down

0 comments on commit fc2f279

Please sign in to comment.