Changeset 784
- Timestamp:
- 12/06/10 06:59:57 (14 years ago)
- Files:
-
- branches/dmd-1.x/src/template.c (modified) (1 diff)
- trunk/src/template.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/dmd-1.x/src/template.c
r768 r784 3816 3816 if (s) 3817 3817 error("template '%s' is not defined, did you mean %s?", id->toChars(), s->toChars()); 3818 3818 else 3819 3819 error("template '%s' is not defined", id->toChars()); 3820 3820 return NULL; 3821 3821 } 3822 3822 #if LOG 3823 3823 printf("It's an instance of '%s' kind '%s'\n", s->toChars(), s->kind()); 3824 3824 if (s->parent) 3825 3825 printf("s->parent = '%s'\n", s->parent->toChars()); 3826 3826 #endif 3827 3827 withsym = scopesym->isWithScopeSymbol(); 3828 3828 3829 3829 /* We might have found an alias within a template when 3830 3830 * we really want the template. 3831 3831 */ 3832 3832 TemplateInstance *ti; 3833 3833 if (s->parent && 3834 3834 (ti = s->parent->isTemplateInstance()) != NULL) 3835 3835 { 3836 if ( 3837 (ti->name == id || 3838 ti->toAlias()->ident == id) 3839 && 3840 ti->tempdecl) 3836 if (ti->tempdecl && ti->tempdecl->ident == id) 3841 3837 { 3842 3838 /* This is so that one can refer to the enclosing 3843 3839 * template, even if it has the same name as a member 3844 3840 * of the template, if it has a !(arguments) 3845 3841 */ 3846 3842 tempdecl = ti->tempdecl; 3847 3843 if (tempdecl->overroot) // if not start of overloaded list of TemplateDeclaration's 3848 3844 tempdecl = tempdecl->overroot; // then get the start 3849 3845 s = tempdecl; 3850 3846 } 3851 3847 } 3852 3848 3853 3849 s = s->toAlias(); 3854 3850 3855 3851 /* It should be a TemplateDeclaration, not some other symbol 3856 3852 */ 3857 3853 tempdecl = s->isTemplateDeclaration(); 3858 3854 if (!tempdecl) 3859 3855 { 3860 3856 if (!s->parent && global.errors) trunk/src/template.c
r768 r784 4291 4291 if (!s) 4292 4292 { error("template '%s' is not defined", id->toChars()); 4293 4293 return NULL; 4294 4294 } 4295 4295 } 4296 4296 4297 4297 #if LOG 4298 4298 printf("It's an instance of '%s' kind '%s'\n", s->toChars(), s->kind()); 4299 4299 if (s->parent) 4300 4300 printf("s->parent = '%s'\n", s->parent->toChars()); 4301 4301 #endif 4302 4302 withsym = scopesym->isWithScopeSymbol(); 4303 4303 4304 4304 /* We might have found an alias within a template when 4305 4305 * we really want the template. 4306 4306 */ 4307 4307 TemplateInstance *ti; 4308 4308 if (s->parent && 4309 4309 (ti = s->parent->isTemplateInstance()) != NULL) 4310 4310 { 4311 if ( 4312 (ti->name == id || 4313 ti->toAlias()->ident == id) 4314 && 4315 ti->tempdecl) 4311 if (ti->tempdecl && ti->tempdecl->ident == id) 4316 4312 { 4317 4313 /* This is so that one can refer to the enclosing 4318 4314 * template, even if it has the same name as a member 4319 4315 * of the template, if it has a !(arguments) 4320 4316 */ 4321 4317 tempdecl = ti->tempdecl; 4322 4318 if (tempdecl->overroot) // if not start of overloaded list of TemplateDeclaration's 4323 4319 tempdecl = tempdecl->overroot; // then get the start 4324 4320 s = tempdecl; 4325 4321 } 4326 4322 } 4327 4323 4328 4324 s = s->toAlias(); 4329 4325 4330 4326 /* It should be a TemplateDeclaration, not some other symbol 4331 4327 */ 4332 4328 tempdecl = s->isTemplateDeclaration(); 4333 4329 if (!tempdecl) 4334 4330 { 4335 4331 if (!s->parent && global.errors)
