Skip to content

Commit

Permalink
error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ivojawer committed Jul 3, 2023
1 parent 7c28f4e commit dd00b97
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions smalltalksrc/Slang/CCodeGenerator.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4416,7 +4416,7 @@ CCodeGenerator >> removeVariable: aName ifAbsent: ifAbsentBlock [
^variables remove: aName ifAbsent: ifAbsentBlock
]
{ #category : #translating }
{ #category : #renaming }
CCodeGenerator >> renameConflictingMethods [
| cFunctionNames toRename |
Expand All @@ -4433,19 +4433,24 @@ CCodeGenerator >> renameConflictingMethods [
toRename := cFunctionNames select: [ :conflicts | conflicts size > 1 ].
toRename keysDo: [ :key |
|conflictingMethods|
| conflictingMethods |
conflictingMethods := toRename at: key.
((conflictingMethods select: [:m | m isAPIMethod ]) size > 1 ) ifTrue: [TranslationError signal: 'Conflicting API methods with name "', key, '"' ].
(toRename at: key) do: [ :method |
"api methods cannot be renamed"
(conflictingMethods select: [ :m | m isAPIMethod ]) size > 1
ifTrue: [
TranslationError signal:
'Conflicting API methods would be translated to "' , key , '"' ].
(conflictingMethods reject: [ :m | m isAPIMethod ]) do: [ :method |
method isStructAccessor ifFalse: [
self
addSelectorTranslation: method selector
to: key , method args size asString ] ] ]
]
{ #category : #translating }
{ #category : #renaming }
CCodeGenerator >> renameKeywordsConflicts [
methods do: [ :method |
Expand Down

0 comments on commit dd00b97

Please sign in to comment.