Skip to content

Commit

Permalink
A single API method is allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
ivojawer committed Jul 26, 2023
1 parent 01325a8 commit 6f86481
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions smalltalksrc/Slang/CCodeGenerator.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4427,8 +4427,6 @@ CCodeGenerator >> renameConflictingLocals [
allFunctions := methods values collect: [ :method |
self cFunctionNameFor: method selector ].
methods do: [ :method |
| renames |
renames := Dictionary new.
Expand Down Expand Up @@ -4456,14 +4454,17 @@ CCodeGenerator >> renameConflictingMethods [
toRename := cFunctionNames select: [ :conflicts | conflicts size > 1 ].
toRename keysAndValuesDo: [ :key :conflictingMethods |
conflictingMethods do: [ :method |
method isAPIMethod ifTrue: [ "api methods cannot be renamed"
(conflictingMethods select: [ :m | m isAPIMethod ]) size > 1
ifTrue: [ "api methods cannot be renamed"
TranslationError signal:
'Conflicting API methods would be translated to "' , key , '"' ].
self
addSelectorTranslation: method selector
to: key , method args size asString ] ]
conflictingMethods
reject: [ :m | m isAPIMethod ]
thenDo: [ :m |
self
addSelectorTranslation: m selector
to: key , m args size asString ] ]
]
{ #category : #renaming }
Expand Down

0 comments on commit 6f86481

Please sign in to comment.