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
Mono Build Error: Optional parameters must appear after all required parameters #657
Comments
Working on the recommended short term fix now, will have a PR soon. |
When building a Godot Mono 3.4 project using the library a build error occurs: `\addons\dialogic\Other\DialogicSharp.cs(16,102): Optional parameters must appear after all required parameters` Made set a default parameter for `dialogScenePath` so that ordering rules for C# are respected and the library builds when used in a project. See C# documentation for more details: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments
I have a PR which I've tested against my own project. Build results after the fix:
The build error is gone and now I'm getting the following error when enabling the plugin, which I suspect is unrelated:
I created a test scene with a dialog and it now runs successfully in godot mono x64 locally on my machine Screenshot of it now working: |
@coppolaemilio the PR fixing this issue: #658 |
The problem
Describe the bug
When building a Godot Mono project that uses the Dialogic plugin, a build error occurs.
To Reproduce
Steps to reproduce the behavior:
addons/dialogic
folder from the dialogic repo into the projectaddons/dialogic/Dialog.tscn
to the root node as a child nodeExpected behavior
Build error:
Solutions
Workaround
No known workaround, it's a build error.
Possible fixes
Short term fix: change add a default value to
String dialogScenePath = ""
. This would be backwards compatible for existing users of the library but I haven't tested if this works.Long term fix: If
dialogScenePath
can't be optional and default to""
, reorder the parameters. This would be backwards incompatible and require support for downstream users of the library.The text was updated successfully, but these errors were encountered: