ICooper,
@ICooper@hachyderm.io avatar

Alright #dotnet hive mind. A question around primary constructors. I just had an issue where the primary constructor took two values:

public class Foo(string bar, Dictionary<string, string> baz)

and then i tried to use them in a method body

public async Task DoStuff(){

var result = DoTheThing(bar);

var value = DoTheOtherThing(result, baz);

}

I created an instance, passed in valid values - but in DoStuff they were null?

What am I missing?

ICooper,
@ICooper@hachyderm.io avatar

Alright, it's not you or me, its #Rider. it's debugger does not seem to display the value of a primary constructor used for storage because the name was pulled into a method correctly.

Relieved, I guess.

davidwengier,
@davidwengier@aus.social avatar
ICooper,
@ICooper@hachyderm.io avatar

@davidwengier yeah, JetBrains seems to imply that is a Rosyln bug, which is fixed in the next SDK release.

Always hairy with new features, it's like "did I not understand"

bitbonk,
@bitbonk@mastodon.social avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • dotnet
  • DreamBathrooms
  • mdbf
  • ethstaker
  • magazineikmin
  • GTA5RPClips
  • rosin
  • thenastyranch
  • Youngstown
  • InstantRegret
  • slotface
  • osvaldo12
  • kavyap
  • khanakhh
  • Durango
  • megavids
  • everett
  • cisconetworking
  • normalnudes
  • tester
  • ngwrru68w68
  • cubers
  • modclub
  • tacticalgear
  • provamag3
  • Leos
  • anitta
  • JUstTest
  • lostlight
  • All magazines