VS2010 environment. A small bug problem with tuple<t> in NET4.0

Source: Internet
Author: User

After starting a desktop program, found a form cfdata=null, the execution of an error, but at the time of initialization, I was clearly cfdata=new cfdata (), why this error occurs.

I started tracking and found that when execution Cfdata=new cfdata (), execution was interrupted, the following code was not executed, but VS2010 did not error, that is, execution to Cfdata=new Cfdata () was wrong! But VS2010 didn't prompt me!

To continue debugging tracing, the problem occurs with the following code that uses the value of the member of the Unassigned tuple<t1,t2>, and VS2010 does not catch the error prompt me:

          Publictuple<string,string,string>spath;  PublicPersonall () {stringSA = ME. Rnowfolder (1,1); stringSB =ZCspathasm20150407; //There is no assignment to the spath, it uses its member value, so it must be wrong, but the VS2010 is not an error, but the execution terminates here, so that the object cannot be instantiated, and the object containing the Personall instance cannot be instantiated. The outermost cfdata cannot be instantiated, so although Cfdata=new Cfdata () is executed, cfdata remains null.             stringsc = spath.item1 +spath.item2; Spath=Newtuple<string,string,string>(SA, SB, SC); }

It's just weird, string sc = spath.item1 + spath.item2; Since the value of the unassigned member is used here, why is the VS2010 execution here not to give a hint, if the prompt, then I know the first step where the error, and do not have to step-to-step debugging to find , perhaps, tuple as a new class, there are still some small problems not perfect it!

VS2010 environment. A small bug problem with tuple<t> in NET4.0

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.