Commit 9f574f5 1 parent 347de2f commit 9f574f5 Copy full SHA for 9f574f5
File tree 1 file changed +4
-8
lines changed
1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -970,18 +970,14 @@ private def checkNoInductiveNameConflicts (elabs : Array InductiveElabStep1) : T
970
970
for { view, .. } in elabs do
971
971
let typeDeclName := privateToUserName view.declName
972
972
if let some (prevNameIsType, prevRef) := uniqueNames[typeDeclName]? then
973
- if prevNameIsType then
974
- throwErrorsAt prevRef view.declId m!"cannot define multiple inductive types with the same name '{typeDeclName}'"
975
- else
976
- throwErrorsAt prevRef view.declId m!"cannot define an inductive type and a constructor with the same name '{typeDeclName}'"
973
+ let declKinds := if prevNameIsType then "multiple inductive types" else "an inductive type and a constructor"
974
+ throwErrorsAt prevRef view.declId m!"cannot define {declKinds} with the same name '{typeDeclName}'"
977
975
uniqueNames := uniqueNames.insert typeDeclName (true , view.declId)
978
976
for ctor in view.ctors do
979
977
let ctorName := privateToUserName ctor.declName
980
978
if let some (prevNameIsType, prevRef) := uniqueNames[ctorName]? then
981
- if prevNameIsType then
982
- throwErrorsAt prevRef ctor.declId m!"cannot define an inductive type and a constructor with the same name '{typeDeclName}'"
983
- else
984
- throwErrorsAt prevRef ctor.declId m!"cannot define multiple constructors with the same name '{ctorName}'"
979
+ let declKinds := if prevNameIsType then "an inductive type and a constructor" else "multiple constructors"
980
+ throwErrorsAt prevRef ctor.declId m!"cannot define {declKinds} with the same name '{ctorName}'"
985
981
uniqueNames := uniqueNames.insert ctorName (false , ctor.declId)
986
982
987
983
private def applyComputedFields (indViews : Array InductiveView) : CommandElabM Unit := do
You can’t perform that action at this time.
0 commit comments