<commit_before>discard """
  output: '''no'''
"""

# test the new 'compiles' feature:

when compiles(4+5.0 * "hallo"):
  echo "yes"
else:
  echo "no"
  
<commit_msg>better test for 'system.compiles'<commit_after>discard """
  output: '''obj has '==': false
int has '==': true
false
true
true
no'''
"""

# test the new 'compiles' feature:

template supports(opr, x: expr): bool {.immediate.} =
  compiles(opr(x)) or compiles(opr(x, x))

type
  TObj = object

var
  myObj {.compileTime.}: TObj

echo "obj has '==': ", supports(`==`, myObj)
echo "int has '==': ", supports(`==`, 45)

echo supports(`++`, 34)
echo supports(`not`, true)
echo supports(`+`, 34)

when compiles(4+5.0 * "hallo"):
  echo "yes"
else:
  echo "no"
{'fraction_non_alphanumeric': 0.2116991643454039, 'fraction_numerical': 0.016713091922005572, 'mean_word_length': 4.406015037593985, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '896672', 'n_tokens_mistral': 286, 'n_tokens_neox': 280, 'n_words': 80}