<p>You need to use the OverloadedStrings Haskell extension.</p>
<p>Add <code>{-# LANGUAGE OverloadedStrings #-}</code> to the top of your file.</p>

CC BY-SA 4.0
2023-03-15T10:23:20.293Z
2023-03-15T10:23:20.293Z
james
<p>I am getting type mismatch when I use traceIfFalse. What could be be reason? And how could I get this resolved. I also noticed that it didn't fail while I build lecture examples.</p>
<ul>
<li>Couldn't match expected type <code>PlutusTx.Builtins.Internal.BuiltinString' with actual type </code>[ghc-prim-0.6.1:GHC.Types.Char]'
<ul>
<li>In the first argument of <code>traceIfFalse', namely </code>&quot;expected boolean True&quot;'
In the first argument of <code>($)', namely </code>traceIfFalse &quot;expected boolean True&quot;'
In the expression:
traceIfFalse &quot;expected boolean True&quot; $ (boolx == True &amp;&amp; boolx == booly)
|
19 | mkValidator _ (boolx, booly) _ = traceIfFalse &quot;expected 42&quot; $ (boolx == True &amp;&amp; boolx == booly)</li>
</ul>
</li>
</ul>

<plutus-pioneer-program>
Week02 Homework 1
# Week02 Homework 1

(Asked by: username_0 on 2023-03-15)

I am getting type mismatch when I use traceIfFalse. What could be be reason? And how could I get this resolved. I also noticed that it didn't fail while I build lecture examples.

* Couldn't match expected type `PlutusTx.Builtins.Internal.BuiltinString' with actual type` [ghc-prim-0.6.1:GHC.Types.Char]'
  + In the first argument of `traceIfFalse', namely` "expected boolean True"'
    In the first argument of `($)', namely` traceIfFalse "expected boolean True"'
    In the expression:
    traceIfFalse "expected boolean True" $ (boolx == True && boolx == booly)
    |
    19 | mkValidator \_ (boolx, booly) \_ = traceIfFalse "expected 42" $ (boolx == True && boolx == booly)

**Tags:** plutus-pioneer-program

---

## 1 answers

### Answer by username_1 on 2023-03-15. Score: 0 | Accepted answer

You need to use the OverloadedStrings Haskell extension.

Add `{-# LANGUAGE OverloadedStrings #-}` to the top of your file.


---

