Skip to content

ConvertError: add back default, new constructor with message #645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

Bromeon
Copy link
Member

@Bromeon Bromeon commented Mar 12, 2024

Fixes #643.

There are unrelated CI errors we'd need to investigate, as upstream changed:

  mismatch in property export_packedbytearray, 
  GDScript: "{ "name": "export_packedbytearray", "class_name": &"", "type": 29, "hint": 23, "hint_string": "2:int", "usage": 4102 }"
    , Rust: "{ "name": "export_packedbytearray", "class_name": &"", "type": 29, "hint": 0, "hint_string": "PackedByteArray", "usage": 4102 }"
  mismatch in property export_packedint32array, 
  GDScript: "{ "name": "export_packedint32array", "class_name": &"", "type": 30, "hint": 23, "hint_string": "2:int", "usage": 4102 }"
    , Rust: "{ "name": "export_packedint32array", "class_name": &"", "type": 30, "hint": 0, "hint_string": "PackedInt32Array", "usage": 4102 }"
  mismatch in property export_packedint64array, 
  GDScript: "{ "name": "export_packedint64array", "class_name": &"", "type": 31, "hint": 23, "hint_string": "2:int", "usage": 4102 }"
    , Rust: "{ "name": "export_packedint64array", "class_name": &"", "type": 31, "hint": 0, "hint_string": "PackedInt64Array", "usage": 4102 }"
  mismatch in property export_packedfloat32array, 
  GDScript: "{ "name": "export_packedfloat32array", "class_name": &"", "type": 32, "hint": 23, "hint_string": "3:float", "usage": 4102 }"
    , Rust: "{ "name": "export_packedfloat32array", "class_name": &"", "type": 32, "hint": 0, "hint_string": "PackedFloat32Array", "usage": 4102 }"
  mismatch in property export_packedfloat64array, 
  GDScript: "{ "name": "export_packedfloat64array", "class_name": &"", "type": 33, "hint": 23, "hint_string": "3:float", "usage": 4102 }"
    , Rust: "{ "name": "export_packedfloat64array", "class_name": &"", "type": 33, "hint": 0, "hint_string": "PackedFloat64Array", "usage": 4102 }"
  mismatch in property export_packedstringarray, 
  GDScript: "{ "name": "export_packedstringarray", "class_name": &"", "type": 34, "hint": 23, "hint_string": "4:String", "usage": 4102 }"
    , Rust: "{ "name": "export_packedstringarray", "class_name": &"", "type": 34, "hint": 0, "hint_string": "PackedStringArray", "usage": 4102 }"
  mismatch in property export_packedvector2array, 
  GDScript: "{ "name": "export_packedvector2array", "class_name": &"", "type": 35, "hint": 23, "hint_string": "5:Vector2", "usage": 4102 }"
    , Rust: "{ "name": "export_packedvector2array", "class_name": &"", "type": 35, "hint": 0, "hint_string": "PackedVector2Array", "usage": 4102 }"
  mismatch in property export_packedvector3array, 
  GDScript: "{ "name": "export_packedvector3array", "class_name": &"", "type": 36, "hint": 23, "hint_string": "9:Vector3", "usage": 4102 }"
    , Rust: "{ "name": "export_packedvector3array", "class_name": &"", "type": 36, "hint": 0, "hint_string": "PackedVector3Array", "usage": 4102 }"
  mismatch in property export_packedcolorarray, 
  GDScript: "{ "name": "export_packedcolorarray", "class_name": &"", "type": 37, "hint": 23, "hint_string": "20:Color", "usage": 4102 }"
    , Rust: "{ "name": "export_packedcolorarray", "class_name": &"", "type": 37, "hint": 0, "hint_string": "PackedColorArray", "usage": 4102 }"

@Bromeon Bromeon added bug c: core Core components labels Mar 12, 2024
@Bromeon Bromeon changed the title Add ConvertError::new() + ::default() ConvertError: add back default, new constructor with message Mar 12, 2024
@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-645

@Bromeon Bromeon force-pushed the bugfix/convert-error-ctor branch from ab43498 to 1d9005a Compare March 12, 2024 08:41
@lilizoey
Copy link
Member

lilizoey commented Mar 12, 2024

i fixed the unrelated ci errors in #625 actually, possibly worth just separating out into its own small PR.

just adding a manual export impl to the packed arrays like:

impl $crate::property::Export for $PackedArray {
            fn default_export_info() -> $crate::property::PropertyHintInfo {
                if sys::GdextBuild::since_api("4.3") {
                    // In 4.3 Godot can (and does) use type hint strings for packed arrays.
                    // https://github.com/godotengine/godot/pull/82952
                    $crate::property::PropertyHintInfo {
                        hint: $crate::engine::global::PropertyHint::TYPE_STRING,
                        hint_string: <$Element as $crate::property::TypeStringHint>::type_string().into(),
                    }
                } else {
                    $crate::property::PropertyHintInfo::with_hint_none(<$PackedArray as $crate::builtin::meta::GodotType>::godot_type_name())
                }

(and removing the auto-generated export impl in property.rs by passing no_export to the macro)

@Bromeon
Copy link
Member Author

Bromeon commented Mar 12, 2024

Oh, great to hear! Yep, would probably be good to merge the fix before the entire #625 👍

I can either cherry pick one of your commits, or you can push a commit to this PR, or open your own separate PR -- whatever works best for you.

@lilizoey
Copy link
Member

I can make a new PR in a little bit, i dont think it'd be super easy to cherry pick out a commit so ill just probably manually copy paste it out. it's a fairly minor chsnge overall.

@lilizoey
Copy link
Member

fixed in #646

@Bromeon Bromeon force-pushed the bugfix/convert-error-ctor branch from 1d9005a to 8544686 Compare March 12, 2024 15:07
@Bromeon Bromeon enabled auto-merge March 12, 2024 15:11
@Bromeon Bromeon added this pull request to the merge queue Mar 12, 2024
Merged via the queue into master with commit fe5b02b Mar 12, 2024
@Bromeon Bromeon deleted the bugfix/convert-error-ctor branch March 12, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug c: core Core components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ConvertError cannot easily be constructed by user?
3 participants