about summary refs log tree commit diff
path: root/users/glittershark/achilles/src/ast
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2021-03-20T19·11-0400
committerglittershark <grfn@gws.fyi>2021-03-20T20·20+0000
commite7033bd8b066c8f4163a4f6aa618a39d8110dc6c (patch)
treedb56bc1e6072cec5a0f09ae23b1b26399189d1f9 /users/glittershark/achilles/src/ast
parente2a3aea4516425ddb2022a85a3d492c605f910d4 (diff)
fix(gs/achilles): Get rid of universalization step r/2295
The step of "universalizing" function expressions was conflicting with
top-level ascriptions for polymorphic function declarations:
universalization generates universal type variables, and top-level
polymorphic ascription *also* generates universal type variables, and
the two were conflicting with each other when unifying. Let's just get
rid of this now, and we can bring it back in a more principled manner
once we do actual let-generalization (which there's still an ignored
test case for)

Change-Id: Idc08c8cb5ac92d1e6e1e63c9b8729176cab73f44
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2616
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
Diffstat (limited to 'users/glittershark/achilles/src/ast')
-rw-r--r--users/glittershark/achilles/src/ast/hir.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/users/glittershark/achilles/src/ast/hir.rs b/users/glittershark/achilles/src/ast/hir.rs
index 0212b3dbcdbb..691b9607e7e6 100644
--- a/users/glittershark/achilles/src/ast/hir.rs
+++ b/users/glittershark/achilles/src/ast/hir.rs
@@ -228,6 +228,13 @@ pub enum Decl<'a, T> {
 }
 
 impl<'a, T> Decl<'a, T> {
+    pub fn name(&self) -> &Ident<'a> {
+        match self {
+            Decl::Fun { name, .. } => name,
+            Decl::Extern { name, .. } => name,
+        }
+    }
+
     pub fn type_(&self) -> Option<&T> {
         match self {
             Decl::Fun { type_, .. } => Some(type_),