Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Misleading ILPP error message when [Rpc] is used inside a local function #3715

Copy link
Copy link
@GitUser187

Description

@GitUser187
Issue body actions

Description

When I put the [Rpc] attribute on top of a local function (for example, inside the Update function), this error message appears: "Unity.Netcode.Editor.CodeGen.NetworkBehaviourILPP: Assets\Scripts\Script.cs(x,x): error - Rpc method must end with 'Rpc' suffix!". This is quite confusing as the function does in fact end with the Rpc suffix. It seems the ILPP is checking the compiler-generated name for local functions (like g__SomethingRpc|0_0), which no longer ends with "Rpc"

Reproduce Steps

  1. Create a NetworkBehaviour class
  2. Inside Update(), define a local function named SomethingRpc
  3. Add the [Rpc] attribute
  4. Let it compile
  5. Observe the confusing error message

Expected Outcome

A more concise error message which specifies that you mustn't have Rpcs be local functions or just the ability to have Rpcs be local functions

Environment

NGO 2.5.0

Reactions are currently unavailable

Metadata

Metadata

Labels

stat:importedStatus - Issue is tracked internally at UnityStatus - Issue is tracked internally at Unitytype:bugBug ReportBug Reporttype:docsDocs feedback or issueDocs feedback or issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.