Indentifier not declared in the current scope

Godot Version

4

Question

I want to create a script to load and save a dictonary, but I alwas get the Error: Parser Error: Identifier “File” not declared in the current scope.

My Script:

var file = File.new()
file.open("res://save_game.txt", File.WRITE)

This is a Godot 3 code. In Godot 4, use FileAccess.