@Kha This one required a bunch of manual fixes. The main issue is that
before we added the string interpolation feature, we created
`MessageData`s using `++` and coercions. For example, given
`(e : Expr)`, we would write
```
let msg : MessageData := "type: " ++ e
```
and rely on the coercions `String -> MessageData` and
`Expr -> MessageData`, and the instance `Append MessageData`.
However, heterogeneous operators "block" the expected type propagation downwards.
This kind of code is obsolete now since we can write a more compact
version using string interpolation
```
let msg := m!"type: {e}"
```
22 lines
404 B
Text
22 lines
404 B
Text
--
|
|
|
|
def A.x : Nat := 10
|
|
def B.x : String := "hello"
|
|
def f (a : Nat) := a + 1
|
|
def g (s : String) := s ++ " world"
|
|
open A
|
|
open B
|
|
#check f x
|
|
#check g x
|
|
|
|
macro "foo!" x:term : term => `($x + (1:Nat))
|
|
macro "foo!" x:term : term => `(Append.append $x " world")
|
|
|
|
#check f (foo! 1)
|
|
#check g (foo! "hello")
|
|
|
|
macro "bla!" : term => `((1 : Nat))
|
|
macro "bla!" : term => `("hello world")
|
|
|
|
#check f bla!
|
|
#check g bla!
|