© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
28 replies
Caeden

❔ Optional function parameter

I have this function

public void abc(Entity entity, List<string> directions, Position occupied = null
public void abc(Entity entity, List<string> directions, Position occupied = null
but I get
CS1750: A type of value <null> cannot be used as a default parameter because there are no standard conversions to type Position
CS1750: A type of value <null> cannot be used as a default parameter because there are no standard conversions to type Position
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

❔ Optional parameter throwing error
C#CC# / help
4y ago
Slash Command optional parameter [Answered]
C#CC# / help
4y ago