1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +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:
Andreas Haas
2017-05-26 19:45:39 +02:00
parent f89641907f
commit 015d36d18b
7 changed files with 12 additions and 8 deletions

View File

@@ -1812,6 +1812,7 @@ void GDScriptLanguage::get_reserved_words(List<String> *p_words) const {
"breakpoint",
"class",
"extends",
"is",
"func",
"preload",
"setget",