Subject: type "synonyms"?
From: Keunwoo Lee (klee@cs.washington.edu)
Date: Tue Feb 06 2001 - 17:52:34 PST
OK, so I have a Cecil type signature like this:
method lower_op(node:UnaryOpNode, op@:ConvertUnaryOp,
analysis:LoweringAnalysis,
graph:AnalysisGraph[IREdge,TopoAnalysisPriority]
):TransformAnalysisAction[GenericLoweringAnalysisInfo,
AnalysisGraph[IREdge,
TopoAnalysisPriority]];
Needless to say, this is a monster. However, this slight shortcut:
method lower_op(node:UnaryOpNode, op@:ConvertUnaryOp,
analysis:LoweringAnalysis,
graph:`G <= AnalysisGraph[IREdge, TopoAnalysisPriority]
):TransformAnalysisAction[GenericLoweringAnalysisInfo, G]];
doesn't typecheck. What, technically, is the difference? Is my
declaration wrong? I would like to save myself at least that small amount
of visual clutter.
Oh, as a usability issue, it would be nice if we could declare a type
synonym and save it for use across many declarations (perhaps in a
module), so I could say:
type MyGraph renames AnalysisGraph[IREdge,TopoAnalysisPriority];
Even a simple lexical substitution would be fine for this. A regular
"subtypes" declaration don't really do the right thing, and we don't have
circular subtyping relations...
~k.lee
This archive was generated by hypermail 2b25 : Tue Feb 06 2001 - 17:52:38 PST