File: impl.cr

package info (click to toggle)
crystal 1.18.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,712 kB
  • sloc: javascript: 6,400; sh: 769; makefile: 300; ansic: 121; python: 105; cpp: 77; xml: 32
file content (56 lines) | stat: -rw-r--r-- 1,015 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class Foo
  property lorem : Int32?

  def foo
    1
  end
end

class Bar
  def foo
    2
  end
end

def bar(o)
  while false
    o.foo
  end
end

def baz(o)
  o.foo
end

puts bar(Foo.new)
puts bar(Bar.new)
puts baz(Foo.new)

Foo.new.lorem

# ./crystal tool implementations samples/impl.cr --cursor samples/impl.cr:17:8
#
# 2 implementations found
# .../samples/impl.cr:4:3
# .../samples/impl.cr:10:3

# ./crystal tool implementations samples/impl.cr --cursor samples/impl.cr:22:5
#
# 1 implementation found
# .../samples/impl.cr:4:3

# ./crystal tool implementations samples/impl.cr --cursor samples/impl.cr:25:7
#
# 1 implementation found
# .../samples/impl.cr:15:1

# ./crystal tool implementations samples/impl.cr --cursor samples/impl.cr:27:3
#
# 1 implementation found
# .../share/crystal/src/kernel.cr:369:1

# ./crystal tool implementations samples/impl.cr --cursor samples/impl.cr:29:9
#
# 1 implementation found
# .../samples/impl.cr:2:3
#  ~> macro property: expanded macro: macro_139913700784656:636:13