Generic Constraints stop Regionerate

If you find any bugs, please post them here.

Generic Constraints stop Regionerate

Postby cameronm » Mon Sep 03, 2007 8:17 am

I've found a problem in 0.6.5.0 where generic constraints stop Regionerate from working.

This sample shows the problem:
Code: Select all
public class RegionerateTest<TGeneric> where TGeneric : new()
{

    private TGeneric _generic;

    public RegionerateTest()
    {
    }

    public TGeneric Generic
    {
        get { return _generic; }
        set { _generic = value; }
    }

    public TGeneric SampleMethod()
    {
        return default(TGeneric);
    }

}


Regionerate works if you don't include the where new() clause, but then the SampleMethod won't compile.
cameronm
 
Posts: 4
Joined: Mon Sep 03, 2007 7:42 am

Re: Generic Constraints stop Regionerate

Postby rauchy » Mon Sep 03, 2007 8:58 pm

cameronm,

Thanks! I'll provide a fix for this in the upcoming version.
-- rauchy.
rauchy
Site Admin
 
Posts: 267
Joined: Wed May 09, 2007 2:39 am
Location: Israel

Re: Generic Constraints stop Regionerate

Postby rauchy » Mon Sep 17, 2007 1:06 am

cameronm,

This is fixed and will be available on v0.6.6.5.

Thank you for reporting the bug.
-- rauchy.
rauchy
Site Admin
 
Posts: 267
Joined: Wed May 09, 2007 2:39 am
Location: Israel

Re: Generic Constraints stop Regionerate

Postby cinderella_2010 » Wed Apr 14, 2010 10:31 am

I also encountered this problem, now i solved it, just change the Method regex. the orginal is as below:
(?<StringRepresentation>\A\s*(?:(?:(?<Comment>(?://.*\n)|(?:/\*(?:[\w\d!@#$%^&*()\[\]<>,.;\\"':|{}`~+=-_?\s]*)?\*/))|(\[\s*(?<Attributes>\w*)[^\[\]]*?\]))\s*)*?(?:(?:(?<Access>protected\s+internal|internal\s+protected|private|public|protected|internal)\s+)?(?:(?<InheritanceModifier>new|abstract|override|virtual)\s+)?(?:(?<Static>static)\s+)?(?:(?<Extern>extern)\s+)?)+(?:(?<Type>\w+(?:[\w,.\?\[\]])*?(?:\<.*>)*?)\s+)?(?<Operator>operator\s+)?\s*(?<Name>~?(?:[\w\=+\-\!\~\d\.])+?)\s*(?:\<(?:\w\.*\d*\,*\s*)+\>)*\s*\((?<Parameters>(?:[^()])*?)\)\s*(?:where\s+.+)?\s*(?:\:\s*(?:this|base)\s*(?:\(?[^\(\)]*(?:(?:(?:(?<OpenC>\()[^\(\)]*)+(?:(?<CloseC-OpenC>\))[^\(\)]*?)+)*(?(OpenC)(?!))\)))\s*)?(?:;|(?<ah>\{[^\{\}]*(?:(?:(?:(?<Open>\{)[^\{\}]*)+(?:(?<Close-Open>\})[^\{\}]*?)+)*(?(Open)(?!))\}))))

now my vesion is as following:
(?<StringRepresentation>\A\s*(?:(?:(?<Comment>(?://.*\n)|(?:/\*(?:[\w\d!@#$%^&*()\[\]<>,.;\\"':|{}`~+=-_?\s]*)?\*/))|(\[\s*(?<Attributes>\w*)[^\[\]]*?\]))\s*)*?(?:(?:(?<Access>protected\s+internal|internal\s+protected|private|public|protected|internal)\s+)?(?:(?<InheritanceModifier>new|abstract|override|virtual)\s+)?(?:(?<Static>static)\s+)?(?:(?<Extern>extern)\s+)?)+(?:(?<Type>\w+(?:[\w,.\?\[\]])*?(?:\<.*>)*?)\s+)?(?<Operator>operator\s+)?\s*(?<Name>~?(?:[\w\=+\-\!\~\d\.])+?)\s*(?:\<(?:\w\.*\d*\,*\s*)+\>)*\s*\((?<Parameters>(?:[^()])*?)\)\s*(?:where\s+\w+\s*\:\s*\w+(?:\(\))?\s*(?:\,\s*\w+\s*)?)*\s*(?:\:\s*(?:this|base)\s*(?:\(?[^\(\)]*(?:(?:(?:(?<OpenC>\()[^\(\)]*)+(?:(?<CloseC-OpenC>\))[^\(\)]*?)+)*(?(OpenC)(?!))\)))\s*)?(?:;|(?<ah>\{[^\{\}]*(?:(?:(?:(?<Open>\{)[^\{\}]*)+(?:(?<Close-Open>\})[^\{\}]*?)+)*(?(Open)(?!))\}))))

hope this is helpful
cinderella_2010
 
Posts: 3
Joined: Wed Apr 14, 2010 9:59 am


Return to Bug Reports

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron