File: comment_inherited_class.swift

package info (click to toggle)
swiftlang 6.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,532 kB
  • sloc: cpp: 9,901,743; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (51 lines) | stat: -rw-r--r-- 4,048 bytes parent folder | download | duplicates (2)
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
// RUN: %target-swift-ide-test -print-comments -source-filename %s | %FileCheck %s
// REQUIRES: no_asan

class Base {
  func noComments() {}
  // CHECK: Func/Base.noComments {{.*}} DocCommentAsXML=none

  /// Base
  func funcNoDerivedComment() {}
  // CHECK: Func/Base.funcNoDerivedComment {{.*}} DocCommentAsXML=[<Function file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>funcNoDerivedComment()</Name><USR>s:14swift_ide_test4BaseC20funcNoDerivedCommentyyF</USR><Declaration>func funcNoDerivedComment()</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract></CommentParts></Function>]

  /// Base
  func funcWithDerivedComment() {}
  // CHECK: Func/Base.funcWithDerivedComment {{.*}} DocCommentAsXML=[<Function file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>funcWithDerivedComment()</Name><USR>s:14swift_ide_test4BaseC22funcWithDerivedCommentyyF</USR><Declaration>func funcWithDerivedComment()</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract></CommentParts></Function>]

  /// Base
  var varNoDerivedComment: Bool {
    return false
  }
  // CHECK: Var/Base.varNoDerivedComment {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>varNoDerivedComment</Name><USR>s:14swift_ide_test4BaseC19varNoDerivedCommentSbvp</USR><Declaration>var varNoDerivedComment: Bool { get }</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract></CommentParts></Other>]

  /// Base
  var varWithDerivedComment: Bool {
    return false
  }
  // CHECK: Var/Base.varWithDerivedComment {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>varWithDerivedComment</Name><USR>s:14swift_ide_test4BaseC21varWithDerivedCommentSbvp</USR><Declaration>var varWithDerivedComment: Bool { get }</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract></CommentParts></Other>]
}

class Derived : Base {
  override func noComments() {}
  // CHECK: Func/Derived.noComments {{.*}} DocCommentAsXML=none

  override func funcNoDerivedComment() {}
  // CHECK: Func/Derived.funcNoDerivedComment {{.*}} DocCommentAsXML=[<Function file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>funcNoDerivedComment()</Name><USR>s:14swift_ide_test7DerivedC06funcNoD7CommentyyF</USR><Declaration>override func funcNoDerivedComment()</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract><Discussion><Note><Para>This documentation comment was inherited from <codeVoice>Base</codeVoice>.</Para></Note></Discussion></CommentParts></Function>]

  /// Derived
  override func funcWithDerivedComment() {}
  // CHECK: Func/Derived.funcWithDerivedComment {{.*}} DocCommentAsXML=[<Function file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>funcWithDerivedComment()</Name><USR>s:14swift_ide_test7DerivedC08funcWithD7CommentyyF</USR><Declaration>override func funcWithDerivedComment()</Declaration><CommentParts><Abstract><Para>Derived</Para></Abstract></CommentParts></Function>]

  override var varNoDerivedComment: Bool {
    return false
  }
  // CHECK: Var/Derived.varNoDerivedComment {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>varNoDerivedComment</Name><USR>s:14swift_ide_test7DerivedC05varNoD7CommentSbvp</USR><Declaration>override var varNoDerivedComment: Bool { get }</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract><Discussion><Note><Para>This documentation comment was inherited from <codeVoice>Base</codeVoice>.</Para></Note></Discussion></CommentParts></Other>]

  // Derived
  override var varWithDerivedComment : Bool {
    return true
  }
  // CHECK: Var/Derived.varWithDerivedComment {{.*}} DocCommentAsXML=[<Other file="{{.*}}" line="{{.*}}" column="{{.*}}"><Name>varWithDerivedComment</Name><USR>s:14swift_ide_test7DerivedC07varWithD7CommentSbvp</USR><Declaration>override var varWithDerivedComment: Bool { get }</Declaration><CommentParts><Abstract><Para>Base</Para></Abstract><Discussion><Note><Para>This documentation comment was inherited from <codeVoice>Base</codeVoice>.</Para></Note></Discussion></CommentParts></Other>]
}