Ryan Roden-Corrent
53a00abb11
Correct superclass constructors in 3to4.
...
Fixes #70542 .
The 3to4 conversion tool was not handling superclass constructors.
We should translate the godot3 syntax:
```gdscript
func _init(a,b,c).(a,b,c):
pass
func _init(a,b,c):
super(a,b,c)
```
Originally, the _init conversion was intended to remove `void` return types from _init functions, as this was disallowed due to #50589 .
As that was resolved by #53366 , I removed that part of the conversion logic. If a void return type is present on a constructor, the converter now leaves it.
Here's a sample diff from my own project:
```diff
@@ -103,10 +105,11 @@ class Real:
class Text:
extends Setting
- var choices: PoolStringArray
- var value: String setget set_value, get_value
+ var choices: PackedStringArray
+ var value: String : get = get_value, set = set_value
- func _init(section: String, key: String, default: String, choice_list: Array).(section, key, default) -> void:
+ func _init(section: String, key: String, default: String, choice_list: Array) -> void:
+ super(section, key, default)
choices = choice_list
func normalize(val):
@@ -129,9 +132,10 @@ class Text:
class Boolean:
extends Setting
- var value: bool setget set_value, get_value
+ var value: bool : get = get_value, set = set_value
- func _init(section: String, key: String, default: bool).(section, key, default) -> void:
+ func _init(section: String, key: String, default: bool) -> void:
+ super(section, key, default)
pass
```
2023-03-04 08:03:24 -05:00
..
2023-02-13 15:22:18 +08:00
2023-03-02 11:41:17 +01:00
2023-01-05 13:25:55 +01:00
2023-02-17 22:42:23 +01:00
2023-02-27 17:24:03 +01:00
2023-03-03 11:03:17 +01:00
2023-03-01 00:11:39 +01:00
2023-02-01 07:29:44 +01:00
2023-01-13 21:48:43 +10:00
2023-01-23 16:43:53 +01:00
2023-01-23 16:43:53 +01:00
2023-02-15 17:00:31 +09:00
2023-01-05 13:25:55 +01:00
2023-02-17 09:55:39 +01:00
2023-02-11 20:48:18 +09:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-02-16 16:17:24 +02:00
2023-02-12 20:53:49 +02:00
2023-02-06 22:56:41 +01:00
2023-02-06 22:56:41 +01:00
2023-01-27 12:26:26 +01:00
2023-01-27 12:26:26 +01:00
2023-01-23 15:30:17 +03:00
2023-01-05 13:25:55 +01:00
2023-01-31 11:54:41 +02:00
2023-01-05 13:25:55 +01:00
2023-01-08 16:15:26 +01:00
2023-01-05 13:25:55 +01:00
2023-01-09 16:56:01 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-02-17 09:50:01 +01:00
2023-01-05 13:25:55 +01:00
2023-02-10 16:55:50 +08:00
2023-01-05 13:25:55 +01:00
2023-02-19 20:58:36 +01:00
2023-01-05 13:25:55 +01:00
2023-02-07 14:20:40 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-19 13:02:18 +01:00
2023-01-23 15:35:44 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-19 20:02:21 +03:00
2023-01-05 13:25:55 +01:00
2023-02-22 11:55:08 +02:00
2023-02-22 11:55:08 +02:00
2023-02-18 12:40:09 +03:00
2023-02-06 07:11:45 -08:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-02-14 11:03:50 +01:00
2023-02-11 20:09:57 +01:00
2023-02-20 09:55:06 +01:00
2023-02-17 15:19:12 +01:00
2023-02-02 01:29:40 +01:00
2023-02-02 01:29:40 +01:00
2023-02-10 16:55:50 +08:00
2023-01-05 13:25:55 +01:00
2023-01-31 18:54:04 +01:00
2023-01-31 18:54:04 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-03-02 11:41:17 +01:00
2023-03-02 11:41:17 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-02-20 17:39:38 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-02-21 12:32:11 +02:00
2023-02-17 14:10:38 +01:00
2023-02-11 22:04:02 +01:00
2023-01-31 11:54:41 +02:00
2023-02-17 16:25:18 +03:00
2023-01-31 23:31:15 +01:00
2023-02-12 15:25:39 +08:00
2023-02-07 14:20:40 +01:00
2023-01-21 14:19:27 +01:00
2023-01-21 14:19:27 +01:00
2023-01-22 17:53:04 +01:00
2023-01-19 16:47:01 +01:00
2023-02-23 20:57:19 +00:00
2023-01-05 13:25:55 +01:00
2023-01-18 09:59:51 +02:00
2023-01-14 22:25:35 +02:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-26 02:59:39 -08:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-18 17:40:13 +01:00
2023-01-05 13:25:55 +01:00
2023-03-03 11:02:53 +01:00
2023-02-21 10:56:14 +01:00
2023-02-07 14:30:16 +01:00
2023-01-12 14:13:49 +01:00
2023-02-22 00:16:39 -08:00
2023-01-05 13:25:55 +01:00
2023-01-20 12:47:05 +02:00
2023-01-20 12:47:05 +02:00
2023-02-27 02:33:49 +00:00
2023-01-17 15:55:40 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-02-07 14:20:40 +01:00
2023-02-07 14:20:40 +01:00
2023-01-16 01:11:52 +01:00
2023-01-16 01:11:52 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-25 20:21:51 +01:00
2023-01-05 13:25:55 +01:00
2023-02-10 16:55:50 +08:00
2023-01-10 23:26:33 +10:00
2023-01-16 10:20:40 +01:00
2023-01-05 13:25:55 +01:00
2023-02-02 09:41:06 +01:00
2023-02-02 09:41:06 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-16 01:11:52 +01:00
2023-01-05 13:25:55 +01:00
2023-01-16 01:11:52 +01:00
2023-01-16 01:11:52 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-02-16 18:19:28 +01:00
2023-01-23 15:08:12 +02:00
2023-02-13 19:18:03 +01:00
2023-01-08 23:25:13 +01:00
2023-01-16 01:11:52 +01:00
2023-01-05 13:25:55 +01:00
2023-01-21 11:28:59 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-23 11:02:20 +01:00
2023-01-23 11:02:20 +01:00
2023-01-06 00:10:06 +01:00
2023-01-05 13:25:55 +01:00
2023-02-21 12:32:11 +02:00
2023-01-23 11:02:20 +01:00
2023-03-04 08:03:24 -05:00
2023-03-02 15:24:00 +01:00
2023-03-02 16:19:30 +08:00
2023-02-17 22:42:23 +01:00
2023-02-13 15:22:18 +08:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-19 16:47:01 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-16 01:11:52 +01:00
2023-01-05 13:25:55 +01:00
2023-02-27 13:34:35 +01:00
2023-02-27 13:34:35 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-09 15:54:04 +03:00
2023-01-05 13:25:55 +01:00
2023-02-01 00:50:34 +01:00
2023-01-05 13:25:55 +01:00
2023-01-24 22:26:03 +03:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-02-07 14:20:40 +01:00
2023-01-05 13:25:55 +01:00
2023-01-05 13:25:55 +01:00
2023-01-16 01:11:52 +01:00
2023-01-05 13:25:55 +01:00