| | 5988 | return e->semantic(sc); |
|---|
| | 5989 | } |
|---|
| | 5990 | |
|---|
| | 5991 | /* Look for overloaded opDispatch to see if we should forward request |
|---|
| | 5992 | * to it. |
|---|
| | 5993 | */ |
|---|
| | 5994 | fd = search_function(sym, Id::opDispatch); |
|---|
| | 5995 | if (fd) |
|---|
| | 5996 | { |
|---|
| | 5997 | /* Rewrite e.ident as: |
|---|
| | 5998 | * e.opDispatch!("ident") |
|---|
| | 5999 | */ |
|---|
| | 6000 | TemplateDeclaration *td = fd->isTemplateDeclaration(); |
|---|
| | 6001 | if (!td) |
|---|
| | 6002 | { |
|---|
| | 6003 | fd->error("must be a template opDispatch(string s), not a %s", fd->kind()); |
|---|
| | 6004 | return new ErrorExp(); |
|---|
| | 6005 | } |
|---|
| | 6006 | StringExp *se = new StringExp(e->loc, ident->toChars()); |
|---|
| | 6007 | TemplateInstance *ti = new TemplateInstance(e->loc, td->ident); |
|---|
| | 6008 | Objects *tiargs = new Objects(); |
|---|
| | 6009 | tiargs->push(se); |
|---|
| | 6010 | ti->tiargs = tiargs; |
|---|
| | 6011 | e = new DotTemplateInstanceExp(e->loc, e, ti); |
|---|
| | 6503 | return e->semantic(sc); |
|---|
| | 6504 | } |
|---|
| | 6505 | |
|---|
| | 6506 | /* Look for overloaded opDispatch to see if we should forward request |
|---|
| | 6507 | * to it. |
|---|
| | 6508 | */ |
|---|
| | 6509 | fd = search_function(sym, Id::opDispatch); |
|---|
| | 6510 | if (fd) |
|---|
| | 6511 | { |
|---|
| | 6512 | /* Rewrite e.ident as: |
|---|
| | 6513 | * e.opDispatch!("ident") |
|---|
| | 6514 | */ |
|---|
| | 6515 | TemplateDeclaration *td = fd->isTemplateDeclaration(); |
|---|
| | 6516 | if (!td) |
|---|
| | 6517 | { |
|---|
| | 6518 | fd->error("must be a template opDispatch(string s), not a %s", fd->kind()); |
|---|
| | 6519 | return new ErrorExp(); |
|---|
| | 6520 | } |
|---|
| | 6521 | StringExp *se = new StringExp(e->loc, ident->toChars()); |
|---|
| | 6522 | TemplateInstance *ti = new TemplateInstance(e->loc, td->ident); |
|---|
| | 6523 | Objects *tiargs = new Objects(); |
|---|
| | 6524 | tiargs->push(se); |
|---|
| | 6525 | ti->tiargs = tiargs; |
|---|
| | 6526 | e = new DotTemplateInstanceExp(e->loc, e, ti); |
|---|