Note [Overloaded labels]
For overloaded labels, note that we /only/ apply `fromLabel` to the
Symbol argument, so the resulting expression has type
fromLabel @"foo" :: forall a. IsLabel "foo" a => a
Now ordinary Visible Type Application can be used to instantiate the 'a':
the user may have written (#foo @Int).
Notice that this all works fine in a kind-polymorphic setting (#19154).
Suppose we have
fromLabel :: forall {k1} {k2} (a:k1). blah
Then we want to instantiate those inferred quantifiers k1,k2, before
type-applying to "foo", so we get
fromLabel @Symbol @blah @"foo" ...
And those inferred kind quantifiers will indeed be instantiated when we
typecheck the renamed-syntax call (fromLabel @"foo"). References 0
This Note does not link to any other.
Referenced by 1
- Handling overloaded and rebindable constructs GHC.Rename.Expr