You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
GDScript: Use "is" keyword for type checking.
Replaces the `extends` keyword with `is` in the context of testing for type compatibility.
`extends` is still used for declaring class inheritance.
Example:
```gdscript
extends Node2D
func _input(ev):
if ev is InputEventKey:
print("yay, key event")
```
This commit is contained in:
@@ -1014,7 +1014,7 @@ int GDCompiler::_parse_expression(CodeGen &codegen, const GDParser::Node *p_expr
|
||||
}
|
||||
|
||||
} break;
|
||||
case GDParser::OperatorNode::OP_EXTENDS: {
|
||||
case GDParser::OperatorNode::OP_IS: {
|
||||
|
||||
ERR_FAIL_COND_V(on->arguments.size() != 2, false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user