CodeGenerator: nullable action parameters

View: New views
4 Messages — Rating Filter:   Alert me  

CodeGenerator: nullable action parameters

by Lee Henson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I've just committed a patch for the CodeGenerator which fixes problems
caused by having nullable action parameters. The buggy generated code
contained things like:

System.Nullable<><System.Int>

rather than

System.Nullable<System.Int>

It's a fairly naive fix, but it's working in all of my scenarios now.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: CodeGenerator: nullable action parameters

by chrisortman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


When I took this patch, it breaks method arguments on actions that are
of a type defined in my web project.

This is because of the change in ControllerVisitor where you now try
to resolve the type using Resolve(typeName,true) instead of just
Resolve(typeName)

Resolve(typeName, true) does not look in the type table entries which
is how types that are defined in the web project would be found.

Also....please....if you are going to reformat all the code don't
reformat _and_ change implementation at the same time, it makes
looking for diff's very painful.

On Jul 22, 11:54 am, Lee Henson <lee.m.hen...@...> wrote:

> I've just committed a patch for the CodeGenerator which fixes problems
> caused by having nullable action parameters. The buggy generated code
> contained things like:
>
> System.Nullable<><System.Int>
>
> rather than
>
> System.Nullable<System.Int>
>
> It's a fairly naive fix, but it's working in all of my scenarios now.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: CodeGenerator: nullable action parameters

by Lee Henson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


When I took this patch, it breaks method arguments on actions that are
of a type defined in my web project.

This is because of the change in ControllerVisitor where you now try
to resolve the type using Resolve(typeName,true) instead of just
Resolve(typeName)

Resolve(typeName, true) does not look in the type table entries which
is how types that are defined in the web project would be found.

Gotcha. I will add a test for that.
 

Also....please....if you are going to reformat all the code don't
reformat _and_ change implementation at the same time, it makes
looking for diff's very painful.

Yeah, that was lazy. I have drowned 1 kitten as penance.
 

On Jul 22, 11:54 am, Lee Henson <lee.m.hen...@...> wrote:
> I've just committed a patch for the CodeGenerator which fixes problems
> caused by having nullable action parameters. The buggy generated code
> contained things like:
>
> System.Nullable<><System.Int>
>
> rather than
>
> System.Nullable<System.Int>
>
> It's a fairly naive fix, but it's working in all of my scenarios now.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: CodeGenerator: nullable action parameters

by Lee Henson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Chris, I have reverted the typeresolver changes I had made previously, and taken a different (nay, superior) tack. Let me know if there are any further issues.

2008/7/24 Lee Henson <lee.m.henson@...>:

When I took this patch, it breaks method arguments on actions that are
of a type defined in my web project.

This is because of the change in ControllerVisitor where you now try
to resolve the type using Resolve(typeName,true) instead of just
Resolve(typeName)

Resolve(typeName, true) does not look in the type table entries which
is how types that are defined in the web project would be found.

Gotcha. I will add a test for that.
 

Also....please....if you are going to reformat all the code don't
reformat _and_ change implementation at the same time, it makes
looking for diff's very painful.

Yeah, that was lazy. I have drowned 1 kitten as penance.
 

On Jul 22, 11:54 am, Lee Henson <lee.m.hen...@...> wrote:
> I've just committed a patch for the CodeGenerator which fixes problems
> caused by having nullable action parameters. The buggy generated code
> contained things like:
>
> System.Nullable<><System.Int>
>
> rather than
>
> System.Nullable<System.Int>
>
> It's a fairly naive fix, but it's working in all of my scenarios now.




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

LightInTheBox - Buy quality products at wholesale price