Mercurial > projects > dang
comparison ast/Exp.d @ 193:658178183018
Added error message for the case of calling a function pointer with wrong parameter count.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Fri, 25 Jul 2008 15:31:16 +0200 |
parents | fda35d57847e |
children | 08f68d684047 |
comparison
equal
deleted
inserted
replaced
192:fda35d57847e | 193:658178183018 |
---|---|
106 override DType type() | 106 override DType type() |
107 { | 107 { |
108 DFunction f = exp.type.asCallable(); | 108 DFunction f = exp.type.asCallable(); |
109 assert(f !is null, "Can only call functions"); | 109 assert(f !is null, "Can only call functions"); |
110 return f.returnType; | 110 return f.returnType; |
111 } | |
112 | |
113 DType callerType() | |
114 { | |
115 DFunction f = new DFunction(new Identifier("function")); | |
116 f.returnType = type; | |
117 foreach (a ; args) | |
118 f.params ~= a.type; | |
119 | |
120 return f; | |
111 } | 121 } |
112 | 122 |
113 override CallExp simplify() | 123 override CallExp simplify() |
114 { | 124 { |
115 foreach (ref arg; args) | 125 foreach (ref arg; args) |